public function toString() { $string = $this->type . ' ' . $this->database->quoteIdentifier($this->table) . ' '; if ($this->alias) { $string .= 'AS ' . $this->database->quoteIdentifier($this->alias) . ' '; } $string .= $this->relation . ' (' . $this->condition . ')'; return $string; }
/** * @param $row * * @return array */ protected function filterColumns($row, $stripPrimary = false) { $columns = $this->database->getFields($this->table); if ($stripPrimary) { $columns = array_filter($columns, function ($column) { if ($this->database->primaryKey($this->table) == $column) { return false; } else { return true; } }); } return array_intersect_key($row, array_flip($columns)); }
/** * @param $identifier * * @return string */ protected function quoteIdentifier($identifier) { return $this->database->quoteIdentifier($identifier); }