Пример #1
0
 /**
  * Overrides base constructor to check sql presence.
  *
  * If the query is constructed with a provided sql query string it will
  * prepare that string and set the PDOStatement object ready to be
  * executed
  *
  * @param array $options A list of name/value pairs for object
  * initialization
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     if (!is_null($this->_sql)) {
         $this->_preparedStatement = $this->_connector->prepare($this->_sql);
     }
 }
Пример #2
0
 /**
  * @param string $uri
  * @throws InvalidArgumentException on non-string $uri argument
  */
 public function __construct($uri = '')
 {
     parent::__construct();
     if (!is_string($uri)) {
         throw new InvalidArgumentException(sprintf('URI passed to constructor must be a string; received "%s"', is_object($uri) ? get_class($uri) : gettype($uri)));
     }
     Parser::parse($uri, $this);
 }
Пример #3
0
 /**
  * Initialize the session driver
  *
  * @param array|object $options
  */
 public function __construct($options = [])
 {
     parent::__construct($options);
     $this->initialize();
 }
 /**
  * Overrides base contructor to call load method
  * 
  * @param array $options
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     $this->_load();
 }
Пример #5
0
 /**
  * Construct - Set the table name and database connector
  * 
  * @param string $tableName 
  * @param \Slick\Database\Connector\ConnectorInterface $connector
  */
 public function __construct($tableName, ConnectorInterface $connector)
 {
     $options = array('tableName' => $tableName, 'connector' => $connector);
     parent::__construct($options);
 }
Пример #6
0
 /**
  * Creates a new SQL statement
  *
  * @param string                               $tableName The database
  *  table for this statment
  * @param array                                $fields    The list of
  *  fields to use in query
  * @param QueryInterface $query     The query object
  *  that gives this statement a context
  */
 public function __construct($tableName, $fields = array('*'), QueryInterface $query = null)
 {
     $options = array('tableName' => $tableName, 'fields' => $fields, 'query' => $query);
     parent::__construct($options);
     $this->_conditions = new Conditions();
 }
Пример #7
0
 /**
  * Creates a new SQL statement
  * 
  * @param string                               $tableName The database
  *  table for this statment
  * 
  * @param \Slick\Database\Query\QueryInterface $query     The query object
  *  that gives this statement a context
  */
 public function __construct($tableName, QueryInterface $query)
 {
     $this->_query = $query;
     $this->_tableName = $tableName;
     parent::__construct();
 }