/** * @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); }
/** * @return array */ public function getColumns() { $columns = \array_keys($this->values); return SyntaxFactory::createColumns($columns, $this->getTable()); }
/** * @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()); }
/** * @return array */ public function getGroupBy() { return SyntaxFactory::createColumns($this->groupBy, $this->getTable()); }