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