public static function doSelectOne(Criteria $criteria, $con = null)
 {
     $critcopy = clone $criteria;
     $critcopy->setLimit(1);
     $objects = VFinalRaportPrintPeer::doSelect($critcopy, $con);
     if ($objects) {
         return $objects[0];
     }
     return null;
 }
Example #2
0
 public function getVFinalRaportPrints($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseVFinalRaportPrintPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collVFinalRaportPrints === null) {
         if ($this->isNew()) {
             $this->collVFinalRaportPrints = array();
         } else {
             $criteria->add(VFinalRaportPrintPeer::SUBJECT_ID, $this->getId());
             VFinalRaportPrintPeer::addSelectColumns($criteria);
             $this->collVFinalRaportPrints = VFinalRaportPrintPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(VFinalRaportPrintPeer::SUBJECT_ID, $this->getId());
             VFinalRaportPrintPeer::addSelectColumns($criteria);
             if (!isset($this->lastVFinalRaportPrintCriteria) || !$this->lastVFinalRaportPrintCriteria->equals($criteria)) {
                 $this->collVFinalRaportPrints = VFinalRaportPrintPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastVFinalRaportPrintCriteria = $criteria;
     return $this->collVFinalRaportPrints;
 }