public function __get($name) { switch ($name) { case 'driver': return static::$_driver; default: return parent::__get($name); } }
public function __get($name) { switch ($name) { case 'connectionString': return $this->cnxString; default: return parent::__get($name); } }
/** * Property getter handler * @param string $name Property name * @return mixed Property value * @throws \DomainException * @see Object::__get() */ public function __get($name) { switch ($name) { case 'app': return $this->_app; default: return parent::__get($name); } }
public function __get($name) { switch ($name) { case 'connection': return $this->cnx; case 'inTransaction': return $this->in; default: return parent::__get($name); } }
public function __get($name) { switch ($name) { case 'connection': return $this->cnx; case 'affectedRows': return $this->getAffectedRows(); default: return parent::__get($name); } }
public function __get($name) { switch ($name) { case 'connection': return $this->cnx; case 'numRows': return count($this); default: return parent::__get($name); } }
public function __set($name, $value) { switch ($name) { case 'bar': if (is_int($value)) { $this->bar = $value; break; } else { throw new PropertyException("A::bar must be an integer"); } default: parent::__set($name, $value); } }
public function __get($name) { switch ($name) { case 'classname': case 'col': case 'ctor_args': case 'callback': $attr = "_{$name}"; return $this->{$attr}; case 'obj': return $this->_obj; default: return parent::__get($name); } }
/** * Property setters handler * @param string $name Property name * @param mixed $value Property value * @throws PropertyException * @see Object::__set() */ public function __set($name, $value) { switch ($name) { case 'config': if (!$value instanceof Config) { throw new PropertyException('Config object excepted, ' . gettype($value) . ' given.'); } elseif ($value->app != $this) { throw new PropertyException('Foreign application given'); } $this->_config = $value; break; case 'error_route': if (!$value instanceof Route) { throw new PropertyException('Route object excepted, ' . gettype($value) . ' given.'); } elseif ($value->app != $this) { throw new PropertyException('Foreign application given'); } $this->_error_route = $value; break; default: parent::__set($name, $value); } }
/** * Connection string builder constructor * @param string $driver Driver name (and database type) */ public function __construct($driver) { parent::__construct(); $this->setDriver($driver); }
/** * Constructor * @param Result $result Result set to iterate on */ public function __construct(Result $result) { parent::__construct(); $this->result = $result; }
/** * Private constructor. Use Type::create() instead. * @param mixed|null $value * @throws TypeMismatchException * @throws InvalidValueException */ private function __construct($value = null) { parent::__construct(); $this->setValue($value); }