load() 공개 정적인 메소드

.. public static function getMetaData(Infusionsoft_Generated_Base &$object, Infusionsoft_App $app = null) { $app = parent::getObjectOrDefaultAppIfNull($app, $object); $params = array( $object->getTable()); $arrayOfFields = $app->send('DataService.getMetaData', $params); return $arrayOfFields; }
public static load ( Infusionsoft_Generated_Base &$object, $id, $returnFields = false, Infusionsoft_App $app = null )
$object Infusionsoft_Generated_Base
$app Infusionsoft_App
예제 #1
0
 public function load($id, $app = null)
 {
     $object = Infusionsoft_DataService::load($this, $id, false, $app);
     $this->loadFromObject($object);
     if ($this->Id == '') {
         throw new Infusionsoft_Exception("Could not load " . $this->table . " with id " . $id);
     }
     Infusionsoft_SdkEventManager::dispatch(new Infusionsoft_SdkEvent($this), 'DataObject.Loaded');
 }
didItWorkInt($out);
?>
</pre>



<h1>Testing Loading of an object by FirstName (findByField)</h1><?php 
$out = Infusionsoft_DataService::findByField(new Infusionsoft_Contact(), 'FirstName', 'Joey', 1, 0);
?>
<pre><?php 
didItWorkNonEmptyArray($out);
?>
</pre>

<h1>Testing Loading of an object by Id (load)</h1><?php 
$out = Infusionsoft_DataService::load(new Infusionsoft_Contact(), $contact->Id);
?>
<pre><?php 
didItWorkObject($out);
?>
</pre>

<h1>Testing Loading of an object by Id Using Query</h1><?php 
$out = Infusionsoft_DataService::query(new Infusionsoft_Contact(), array('Id' => $contact->Id));
?>
<pre><?php 
didItWorkNonEmptyArray($out);
?>
</pre>

<h1>Testing Loading of an object by Id Using Query With Order By</h1><?php 
<form>
            table: <input type="text" name="table" value="<?php 
if (isset($_REQUEST['table'])) {
    echo htmlspecialchars($_REQUEST['table']);
}
?>
"><br/>
            id: <input type="text" name="id" value="<?php 
if (isset($_REQUEST['id'])) {
    echo htmlspecialchars($_REQUEST['id']);
}
?>
"><br/>
            selectedFields: <input type="text" name="selectedFields" value="<?php 
if (isset($_REQUEST['selectedFields'])) {
    echo htmlspecialchars($_REQUEST['selectedFields']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_DataService::load($_REQUEST['table'], $_REQUEST['id'], $_REQUEST['selectedFields']);
    var_dump($out);
}