/** * @param Fluent $fluent * @param array $criteria * @return Fluent */ private static function applyCriteria(Fluent $fluent, array $criteria) { foreach ($criteria as $key => $val) { if (is_int($key)) { $fluent->where(...$val); } else { $fluent->where($key, $val); } } return $fluent; }
private function commandOffset($offset) { $this->fluent->offset($offset); }
/** * @param Fluent $statement * @param $table */ private function modifyStatement(Fluent $statement, $table) { $statement->select('t.*')->leftJoin('%n t', $this->mapper->getTranslationsTable($table))->on('t.%n = %n.%n', $this->mapper->getTranslationsColumn($table), $table, $this->mapper->getPrimaryKey($table))->where('language_id = %s', $this->language->getLanguage()->id); }
/** * @param Fluent $statement * @return Entity[] */ public function fetchStatement(Fluent $statement) { return $this->createEntities($statement->fetchAll()); }
public function modify(Fluent $statement) { $statement->orderBy('[order]', 'ASC'); }
public function depth(Fluent $statement, $depth = NULL) { if ($depth === NULL) { $depth = self::DEFAULT_DEPTH; } $statement->where('[depth] = %s', $depth); }