Пример #1
0
 /**
  * Result set constructor
  * @param Connection $cnx Parent connection
  */
 public function __construct(Connection $cnx)
 {
     parent::__construct();
     $this->cnx = $cnx;
     $this->fetchMode = $this->connection->getDefaultFetchMode();
     $this->prefetch();
 }
Пример #2
0
 /**
  * Transaction constructor
  * @param Connection $cnx Parent connection
  * @param string|null $name Transaction name. Null if none.
  * @throws DBException
  */
 public function __construct(Connection $cnx, $name = null)
 {
     parent::__construct();
     $this->cnx = $cnx;
     $this->name = $name;
     $this->in = $this->doStart($this->name);
 }
Пример #3
0
 /**
  * Application constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->_name = basename(get_called_class());
     $this->_request = new HTTPRequest($this);
     $this->_response = new HTTPResponse($this);
     $this->_config = new Config($this);
 }
Пример #4
0
 /**
  * Connection constructor
  * @param string $connectionString Connection string
  * @throws ConnectionFailedException
  */
 public function __construct($connectionString)
 {
     parent::__construct();
     $this->cnxString = $connectionString;
     $query = parse_url($this->connectionString, PHP_URL_QUERY);
     if (!empty($query)) {
         parse_str($query, $this->attributes);
     }
     $this->defaultFetchMode = is_null($a = $this->getAttribute(DB::ATTR_DEFAULT_FETCH_MODE)) ? new FetchMode(DB::FETCH_ASSOC) : unserialize($a);
     $this->connect();
 }
Пример #5
0
 /**
  * Fetch mode constructor
  * @param int $mode Actual fetch mode : combinaison of Result::FETCH_* constants
  * @param mixed $param For some modes, additionnal parameter
  * @param array $ctor_args For FETCH_CLASS mode : constructor arguments
  */
 public function __construct($mode, &$param = null, array $ctor_args = array())
 {
     parent::__construct();
     $this->_mode = $mode;
     if ($this->hasMode(DB::FETCH_CLASS) and !$this->hasMode(DB::FETCH_CLASSTYPE) and !$this->hasMode(DB::FETCH_OBJ)) {
         $this->_classname = $param;
         $this->_ctor_args = $ctor_args;
     } elseif ($this->hasMode(DB::FETCH_INTO)) {
         $this->_obj =& $param;
     } elseif ($this->hasMode(DB::FETCH_COLUMN)) {
         $this->_col = $param;
     } elseif ($this->hasMode(DB::FETCH_CALLBACK)) {
         $this->_callback = $param;
     }
 }
Пример #6
0
 /**
  * Component constructor
  * @param Application $app Parent application
  * @see Object
  */
 public function __construct(Application $app)
 {
     parent::__construct();
     $this->_app = $app;
 }
Пример #7
0
 /**
  * Connection string builder constructor
  * @param string $driver Driver name (and database type)
  */
 public function __construct($driver)
 {
     parent::__construct();
     $this->setDriver($driver);
 }
Пример #8
0
 /**
  * Constructor
  * @param Result $result Result set to iterate on
  */
 public function __construct(Result $result)
 {
     parent::__construct();
     $this->result = $result;
 }
Пример #9
0
 /**
  * Statement constructor
  * @param Connection $cnx Parent connection
  */
 public function __construct(Connection $cnx)
 {
     parent::__construct();
     $this->cnx = $cnx;
 }
Пример #10
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);
 }