|
|
|
|||||
|
php ice interface struct initialization
Hi,
Is there a way to add a constructor to initialize a struct instance. I need to pass this as a parameter as shown in the code fragment. thanks, Don // section from CU.ice: module CU { // Transaction, becomes CU_Transaction struct Transaction { string posteff; int account; ... } bool transfer(Transaction from, Transaction to) throws PostError; } // testing usage of transfer from PHP $xferfrom = array ("posteff" => "2006-05-15","account" => (int)12345, "suffix" => (int)51, "accttype" => "S","mnemonic" => "SDT", "amount" => (double)12345.67); $fromshr = new CU_Transaction($xferfrom); // constructor doesn't work, so initialize the hard way $fromshr->posteff = '2006-05-16'; $fromshr->account = 2; $fromshr->accttype = 83; $fromshr->suffix = 1; $fromshr->mnemonic = 'SWX'; $fromshr->amount = 100; $fromshr->descr = 'xfer test from php'; // now post the transfer $ok = $gcu->transfer($fromshr, $toshr); // it works!, PHP and Ice are Great!
__________________
Don Thompson Digital Federal Credit Union www.dcu.org Ice Project: credit union core processing prototype which may expand to open source project. Current Environment: Debian Linux Sarge, mysql 4.1.11-Debian, mysql++ v 2.1.0.beta1, qt3 v 3.3.4, Ice-3.0.1 IcePHP-3.0.1 Server: c++ using mysql++ to access mysql db, with Ice interfaces. Desktop Client: c++ using qt3, Ice interfaces to Server Home Banking Client: Python using IcePy interface to Server Currently using PHP Client |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| python: Ice.initialize with initialization data fails | hiasl | Bug Reports | 1 | 02-05-2007 09:59 AM |
| ICE and COM initialization question | gasproni | Help Center | 1 | 11-11-2005 07:43 AM |
| Feature Request: generate constructors with parameter for initialization | DeepDiver | Comments | 2 | 01-04-2005 11:05 AM |
| Initialization of IceSSL | rhochmuth | Help Center | 1 | 05-13-2004 08:05 PM |
| class with operations, Initialization | StuartA | Help Center | 6 | 02-22-2004 07:58 PM |