public function getVMonthlys($criteria = null, $con = null) { include_once 'lib/model/om/BaseVMonthlyPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collVMonthlys === null) { if ($this->isNew()) { $this->collVMonthlys = array(); } else { $criteria->add(VMonthlyPeer::ACADEMIC_COST_ID, $this->getId()); VMonthlyPeer::addSelectColumns($criteria); $this->collVMonthlys = VMonthlyPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(VMonthlyPeer::ACADEMIC_COST_ID, $this->getId()); VMonthlyPeer::addSelectColumns($criteria); if (!isset($this->lastVMonthlyCriteria) || !$this->lastVMonthlyCriteria->equals($criteria)) { $this->collVMonthlys = VMonthlyPeer::doSelect($criteria, $con); } } } $this->lastVMonthlyCriteria = $criteria; return $this->collVMonthlys; }
public static function doSelectOne(Criteria $criteria, $con = null) { $critcopy = clone $criteria; $critcopy->setLimit(1); $objects = VMonthlyPeer::doSelect($critcopy, $con); if ($objects) { return $objects[0]; } return null; }