/** * Get all projects * * @return array ? */ public function getAll($budget) { $this->_validateBudget($budget); $projects = $this->repo->findBy(array('budget' => $budget), array('name' => 'ASC')); $this->_loadOwnerObjects($projects); return $projects; }
/** * Get all SubProjects * * @return array ? */ public function getAll($project, $allocatedAmountData = false) { $this->_validateProject($project); $subProjects = $this->repo->findBy(array('project' => $project->getId()), array('name' => 'ASC')); if ($allocatedAmountData !== false) { $this->_loadAllocatedAmounts($subProjects, $allocatedAmountData); } return $subProjects; }
/** * @param array $criteria * @param array|null $orderBy * @param integer|null $limit * @param integer|null $offset * @return array|null */ public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) { $cache = $this->em->getCache(); $cacheKey = $this->className . ':'; if ($criteria) { $cacheKey .= implode(',', $criteria); } if ($orderBy) { $cacheKey .= implode(',', $orderBy); } if ($limit) { $cacheKey .= $limit; } if ($offset) { $cacheKey .= $offset; } if ($cache->contains($cacheKey)) { return $cache->fetch($cacheKey); } $result = parent::findBy($criteria, $orderBy, $limit, $offset); if ($result) { $cache->save($cacheKey, $result, 60 * 10); } return $result; }
/** * Get all Transaction * * @return array ? */ public function getAll($subProject) { $this->_validateSubProject($subProject); $transactions = $this->repo->findBy(array('subProject' => $subProject->getId()), array('name' => 'ASC')); return $transactions; }
/** * Get all budgets * * @return array */ public function getAll() { $budgets = $this->repo->findBy(array(), array('name' => 'ASC')); $this->_loadOwnerObjects($budgets); return $budgets; }