public function getBudgets($criteria = null, $con = null) { include_once 'lib/model/om/BaseBudgetPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collBudgets === null) { if ($this->isNew()) { $this->collBudgets = array(); } else { $criteria->add(BudgetPeer::BUDGET_CHART_ID, $this->getId()); BudgetPeer::addSelectColumns($criteria); $this->collBudgets = BudgetPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(BudgetPeer::BUDGET_CHART_ID, $this->getId()); BudgetPeer::addSelectColumns($criteria); if (!isset($this->lastBudgetCriteria) || !$this->lastBudgetCriteria->equals($criteria)) { $this->collBudgets = BudgetPeer::doSelect($criteria, $con); } } } $this->lastBudgetCriteria = $criteria; return $this->collBudgets; }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(BudgetPeer::ID, $pks, Criteria::IN); $objs = BudgetPeer::doSelect($criteria, $con); } return $objs; }