Example #1
0
 /**
  * Clear statement PDO and query builder
  */
 public function clear()
 {
     $this->statement = null;
     $this->clearUsingModel();
     $this->query->clear();
     $this->grammar->clear();
 }
Example #2
0
 /**
  * @return string
  */
 private function selectColumn()
 {
     $columns = $this->query->columns;
     if (is_null($columns)) {
         $columns = [Query::sql("*")];
     }
     if (is_string($columns)) {
         $columns = array($columns);
     }
     foreach ($columns as $key => $val) {
         if ($columns[$key] instanceof Query) {
             $columns[$key] = $columns[$key]->query;
         } else {
             $columns[$key] = $this->getFormattedTableOrColumn($val);
         }
     }
     return implode(', ', $columns);
 }
Example #3
0
 /**
  * @param $query
  * @param string $type
  * @return Query
  */
 public function whereQ(Query $query, $type = "AND")
 {
     if ($query->getType() == Query::TYPE_QUERY) {
         $this->attributes['where'][] = array($type, $query->query);
     }
     return $this;
 }