Ejemplo n.º 1
0
 /**
  * @param Where $where
  * @param array $whereArray
  *
  * @return array
  */
 protected function writeWhereMatches(Where $where, array &$whereArray)
 {
     $matches = [];
     foreach ($where->getMatches() as $values) {
         $columns = SyntaxFactory::createColumns($values['columns'], $where->getTable());
         $columnNames = $this->getColumnNames($columns);
         $columnValues = array(implode(" ", $values['values']));
         $columnValues = implode(", ", $this->writer->writeValues($columnValues));
         $matches[] = str_replace(['{{columnNames}}', '{{columnValues}}'], [$columnNames, $columnValues], $this->matchMode[$values['mode']]);
     }
     $whereArray = array_merge($whereArray, $matches);
 }
Ejemplo n.º 2
0
 /**
  * @return array
  */
 public function getColumns()
 {
     $columns = \array_keys($this->values);
     return SyntaxFactory::createColumns($columns, $this->getTable());
 }
Ejemplo n.º 3
0
 /**
  * @return \NilPortugues\Sql\QueryBuilder\Syntax\Column
  *
  * @throws QueryException
  */
 public function getColumns()
 {
     if (\is_null($this->select->getTable())) {
         throw new QueryException('No table specified for the Select instance');
     }
     return SyntaxFactory::createColumns($this->columns, $this->select->getTable());
 }
Ejemplo n.º 4
0
 /**
  * @return array
  */
 public function getGroupBy()
 {
     return SyntaxFactory::createColumns($this->groupBy, $this->getTable());
 }