/** * @param $pageColumn PageColumn * @return PageColumnDto */ public function mapPageColumnToDto(PageColumn $pageColumn) { $pageColumnDto = new PageColumnDto(); $pageColumnDto->setId($pageColumn->getId()); $pageColumnDto->setPageRowId($pageColumn->getPageRowId()); $pageColumnDto->setComponents($this->pageCompentMapper->mapPageComponentListToDto($pageColumn->getComponents())); $pageColumnDto->setPosition($pageColumn->getPosition()); return $pageColumnDto; }
public function getEntityWithLowerPosition(PageColumn $movedEntity) { $criteria = new SelectCriteria($this->getDomain()); $positionCriteria = Criterion::_gt($this->getDomain(), "position", $movedEntity->getPosition()); $rowCriteria = Criterion::_eq($this->getDomain(), "pageRowId", $movedEntity->getPageRowId()); $criteria->setCriteria(Criterion::_and($positionCriteria, $rowCriteria)); $criteria->addTransformer(Transformer::_limit(1)); $criteria->addTransformer(Transformer::_orderBy($this->getDomain(), "position", false)); return $criteria->toUnique(); }
public function createPageColumn(PageColumn $pageColumn) { $pageColumn->setPosition($this->pageColumnDao->getAmountOfRowsOfPage($pageColumn->getPageRowId())); $this->pageColumnDao->create($pageColumn); }