Exemplo n.º 1
0
 function __construct(Database $db, $into)
 {
     parent::__construct($db);
     $this->_table = str_replace($this->getGraveAccent(), '', $into);
     // TODO null check on $into
     return $this;
 }
Exemplo n.º 2
0
 function __construct(Database $db, array $fields = null)
 {
     parent::__construct($db);
     foreach ($fields as $field) {
         $this->_fields[] = str_replace($this->getGraveAccent(), '', $field);
         // add the field to the array of fields, remove any `s for the field name
     }
     return $this;
 }
Exemplo n.º 3
0
 /**
  * @param string|Table|null $table
  * @param string|array|Column[] $cols
  */
 public function __construct($table = null, $cols = array(Column::ALL))
 {
     parent::__construct();
     if ($table) {
         $this->setTable($table);
     }
     if (count($cols)) {
         $this->setColumns($cols);
     }
 }
Exemplo n.º 4
0
 /**
  * Constructor.
  *
  * @param  string optional $query SPARQL query string to initialize this instance.
  */
 public function __construct($query = '')
 {
     parent::__construct($query);
     if (null === $this->query) {
         return;
     }
     $parts = array('select' => array(), 'from' => array(), 'from_named' => array(), 'where' => array(), 'order' => array(), 'limit' => array(), 'offset' => array());
     // regex for variables
     $var = '[?$]{1}[\\w\\d]+';
     $tokens = array('select' => '/(' . '((SELECT(\\s)+)(DISTINCT(\\s)+)' . '?(COUNT(\\s)*(\\(.*?\\)(\\s)))?)(\\?\\w+\\s+|\\*)*' . '(\\(LANG\\(\\?[a-zA-Z0-9\\_]+\\)\\)* as{1}\\s\\?[a-zA-Z0-9\\_]+)*' . ')/si', 'from' => '/FROM\\s+<(.+?)>/i', 'from_named' => '/FROM\\s+NAMED\\s+<(.+?)>/i', 'where' => '/(WHERE\\s+)?\\{.*\\}/si', 'order' => '/ORDER\\s+BY((\\s+' . $var . '|\\s+(ASC|DESC)\\s*\\(\\s*' . $var . '\\s*\\))+)/i', 'limit' => '/LIMIT\\s+(\\d+)/i', 'offset' => '/OFFSET\\s+(\\d+)/i');
     foreach ($tokens as $key => $pattern) {
         preg_match_all($pattern, $query, $parts[$key]);
     }
     if (isset($parts['select'][0][0])) {
         $this->queryParts['select'] = trim($parts['select'][0][0]);
     }
     /**
      * FROM
      */
     if (isset($parts['from'][1][0])) {
         $this->queryParts['graphs'] = $parts['from'][1];
     }
     /**
      * FROM NAMED
      */
     if (isset($parts['from_named'][1][0])) {
         $this->queryParts['named_graphs'] = $parts['from_named'][1];
     }
     /**
      * WHERE
      */
     if (isset($parts['where'][0][0])) {
         $this->queryParts['where'] = $parts['where'][0][0];
     }
     /**
      * ORDER BY
      */
     if (isset($parts['order'][1][0])) {
         $this->queryParts['order'] = trim($parts['order'][1][0]);
     }
     /**
      * LIMIT
      */
     if (isset($parts['limit'][1][0])) {
         $this->queryParts['limit'] = $parts['limit'][1][0];
     }
     /**
      * OFFSET
      */
     if (isset($parts['offset'][1][0])) {
         $this->queryParts['offset'] = $parts['offset'][1][0];
     }
 }
Exemplo n.º 5
0
 public function __construct(&$doorGets = null)
 {
     parent::__construct($doorGets);
 }
Exemplo n.º 6
0
 function __construct(Database $db, $table)
 {
     parent::__construct($db);
     $this->_table = $table;
     return $this;
 }
Exemplo n.º 7
0
 function __construct(Database $db)
 {
     parent::__construct($db);
     return $this;
 }
Exemplo n.º 8
0
 /**
  * @param \PDO   $pdo
  * @param string $tableName
  */
 public function __construct(\PDO $pdo, $tableName)
 {
     parent::__construct($pdo, $tableName, $this->sql);
 }
Exemplo n.º 9
0
 /**
  * @param object|string $class_name
  * @param string[]      $indices
  */
 public function __construct($class_name, array $indices = [])
 {
     parent::__construct($class_name);
     $this->indices = $indices;
 }
Exemplo n.º 10
0
 /**
  * @param \SolrInputDocument $document
  */
 public function __construct(\SolrInputDocument $document)
 {
     parent::__construct();
     $this->document = $document;
 }
Exemplo n.º 11
0
 /**
  * Initializes a new instance of the <tt>NativeQuery</tt> class that is bound
  * to the given EntityManager.
  *
  * @param EntityManager $em
  */
 public function __construct(EntityManager $em)
 {
     parent::__construct($em);
 }