/** * Get items * @author Mohamed Labib <*****@*****.**> * * @access public * * @param int $offset * @param int $itemCountPerPage * @return array items queried */ public function getItems($offset, $itemCountPerPage) { $this->setCriteria(); $this->criteria->setFirstResult($offset); $this->criteria->setMaxResults($itemCountPerPage); return $this->query->filter($this->entityName, $this->criteria); //($pageNumber-1) for zero based count }
/** * Remove not used outlines * * @access public */ public function cleanUpOutlines() { $criteria = Criteria::create(); $expr = Criteria::expr(); $criteria->andWhere($expr->isNull("course")); $outlinesToBeRemoved = $this->query->filter("Courses\\Entity\\Outline", $criteria); foreach ($outlinesToBeRemoved as $outline) { $this->query->remove($outline); } }