コード例 #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
ファイル: Uri.php プロジェクト: slickframework/http
 /**
  * @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();
 }
コード例 #4
0
 /**
  * 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();
 }