コード例 #1
0
 /**
  * (PHP 5 &gt;= 5.0.0)<br/>
  * Offset to retrieve
  *
  * @link http://php.net/manual/en/arrayaccess.offsetget.php
  *
  * @param mixed $offset <p>
  *                      The offset to retrieve.
  *                      </p>
  *
  * @return mixed Can return all value types.
  */
 public function offsetGet($offset)
 {
     if (property_exists($this->jsonData, $offset)) {
         return GatewayFactory::factory($this->jsonData->{$offset});
     }
     return null;
 }
コード例 #2
0
 public function loadGateway($id = false, $extra = array())
 {
     $acc = $this->find("first", array("conditions" => array("GatewayAccount.id" => $id), "contain" => array()));
     $acc = array_merge($acc, $extra);
     $obj = GatewayFactory::getGateway($acc);
     return $obj;
 }
コード例 #3
0
 /**
  * Offset to retrieve
  *
  * @link http://php.net/manual/en/arrayaccess.offsetget.php
  *
  * @param mixed $offset The offset to retrieve.
  *
  * @return mixed Can return all value types.
  */
 public function offsetGet($offset)
 {
     if (isset($this->jsonData[$offset])) {
         return GatewayFactory::factory($this->jsonData[$offset]);
     }
     return null;
 }
コード例 #4
0
 public function testShouldBeScalar()
 {
     $fixture = 4711;
     $val = GatewayFactory::factory($fixture);
     $this->assertSame($fixture, $val);
 }