Ejemplo n.º 1
0
 public function __get($name)
 {
     switch ($name) {
         case 'driver':
             return static::$_driver;
         default:
             return parent::__get($name);
     }
 }
Ejemplo n.º 2
0
 public function __get($name)
 {
     switch ($name) {
         case 'connectionString':
             return $this->cnxString;
         default:
             return parent::__get($name);
     }
 }
Ejemplo n.º 3
0
 /**
  * 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);
     }
 }
Ejemplo n.º 4
0
 public function __get($name)
 {
     switch ($name) {
         case 'connection':
             return $this->cnx;
         case 'inTransaction':
             return $this->in;
         default:
             return parent::__get($name);
     }
 }
Ejemplo n.º 5
0
 public function __get($name)
 {
     switch ($name) {
         case 'connection':
             return $this->cnx;
         case 'affectedRows':
             return $this->getAffectedRows();
         default:
             return parent::__get($name);
     }
 }
Ejemplo n.º 6
0
 public function __get($name)
 {
     switch ($name) {
         case 'connection':
             return $this->cnx;
         case 'numRows':
             return count($this);
         default:
             return parent::__get($name);
     }
 }
Ejemplo n.º 7
0
 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);
     }
 }
Ejemplo n.º 8
0
 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);
     }
 }
Ejemplo n.º 9
0
 /**
  * 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);
     }
 }
Ejemplo n.º 10
0
 /**
  * Connection string builder constructor
  * @param string $driver Driver name (and database type)
  */
 public function __construct($driver)
 {
     parent::__construct();
     $this->setDriver($driver);
 }
Ejemplo n.º 11
0
 /**
  * Constructor
  * @param Result $result Result set to iterate on
  */
 public function __construct(Result $result)
 {
     parent::__construct();
     $this->result = $result;
 }
Ejemplo n.º 12
0
 /**
  * Private constructor. Use Type::create() instead.
  * @param mixed|null $value
  * @throws TypeMismatchException
  * @throws InvalidValueException
  */
 private function __construct($value = null)
 {
     parent::__construct();
     $this->setValue($value);
 }