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