Forum und email

OrbitStruct

(No version information available, might be only in CVS)

OrbitStruct — Use CORBA structs

Description

new OrbitStruct ( string $id )
Warning

這個函數是實驗性質的。這個函數的行為ã€å稱ã€å’Œé—œæ–¼æ­¤å‡½æ•¸çš„任何其他文件在未來PHP的發行中å¯èƒ½æœƒåœ¨ä¸é€šçŸ¥çš„æƒ…æ³ä¸‹æ”¹è®Šã€‚ 使用此延伸需自行承擔風險。

This class represents the structure identified with the id parameter.

Parameters

id

Can be either the name of the struct (e.g "MyStruct"), or the full repository id (e.g. "IDL:MyStruct:1.0").

範例

Example#1 Sample IDL file

struct MyStruct {
    short shortvalue;
    string stringvalue;
};

interface SomeInterface {
  void SetValues (MyStruct values);
  MyStruct GetValues();
}

Example#2 PHP code for accessing MyStruct

<?php
$obj 
= new OrbitObject ($ior);

$initial_values = new OrbitStruct ("IDL:MyStruct:1.0");
$initial_values->shortvalue 42;
$initial_values->stringvalue "HGTTG";

$obj->SetValues ($initial_values);

$values $obj->GetValues();

echo 
$values->shortvalue;
echo 
$values->stringvalue;
?>