public function getEntityWithLowerPosition(Page $movedEntity) { $criteria = new SelectCriteria($this->getDomain()); $criteria->setCriteria(Criterion::_gt($this->getDomain(), "position", $movedEntity->getPosition())); $criteria->addTransformer(Transformer::_limit(1)); $criteria->addTransformer(Transformer::_orderBy($this->getDomain(), "position", false)); return $criteria->toUnique(); }
public function getEntityWithLowerPosition(PageComponent $movedEntity) { $criteria = new SelectCriteria($this->getDomain()); $positionCriteria = Criterion::_gt($this->getDomain(), "position", $movedEntity->getPosition()); $columnCriteria = Criterion::_eq($this->getDomain(), "pageColumnId", $movedEntity->getPageColumnId()); $criteria->setCriteria(Criterion::_and($positionCriteria, $columnCriteria)); $criteria->addTransformer(Transformer::_limit(1)); $criteria->addTransformer(Transformer::_orderBy($this->getDomain(), "position", false)); return $criteria->toUnique(); }
public function getConfirmedCompanies($page, $rowCount) { $criteria = $this->getCompaniesWithStatusCriteria(2); $criteria->addTransformer(Transformer::_limit($page * $rowCount, $rowCount)); return $criteria->toArray(); }