/** * (PHP 5 >= 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; }
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; }
/** * 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; }
public function testShouldBeScalar() { $fixture = 4711; $val = GatewayFactory::factory($fixture); $this->assertSame($fixture, $val); }