Пример #1
0
 /**
  * Gets an array of Featurevectorsegment objects which contain a foreign key that references this object.
  *
  * If this collection has already been initialized with an identical Criteria, it returns the collection.
  * Otherwise if this File has previously been saved, it will retrieve
  * related Featurevectorsegments from storage. If this File is new, it will return
  * an empty collection or the current collection, the criteria is ignored on a new object.
  *
  * @param      PropelPDO $con
  * @param      Criteria $criteria
  * @return     array Featurevectorsegment[]
  * @throws     PropelException
  */
 public function getFeaturevectorsegments($criteria = null, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(FilePeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collFeaturevectorsegments === null) {
         if ($this->isNew()) {
             $this->collFeaturevectorsegments = array();
         } else {
             $criteria->add(FeaturevectorsegmentPeer::FILE_ID, $this->id);
             FeaturevectorsegmentPeer::addSelectColumns($criteria);
             $this->collFeaturevectorsegments = FeaturevectorsegmentPeer::doSelect($criteria, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return the collection.
             $criteria->add(FeaturevectorsegmentPeer::FILE_ID, $this->id);
             FeaturevectorsegmentPeer::addSelectColumns($criteria);
             if (!isset($this->lastFeaturevectorsegmentCriteria) || !$this->lastFeaturevectorsegmentCriteria->equals($criteria)) {
                 $this->collFeaturevectorsegments = FeaturevectorsegmentPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastFeaturevectorsegmentCriteria = $criteria;
     return $this->collFeaturevectorsegments;
 }
Пример #2
0
 /**
  * Retrieve object using using composite pkey values.
  * @param      int $segmentnr
  * @param      int $track_id
  * @param      int $featurevectortype_id
  * @param      PropelPDO $con
  * @return     Featurevectorsegment
  */
 public static function retrieveByPK($segmentnr, $track_id, $featurevectortype_id, PropelPDO $con = null)
 {
     $key = serialize(array((string) $segmentnr, (string) $track_id, (string) $featurevectortype_id));
     if (null !== ($obj = FeaturevectorsegmentPeer::getInstanceFromPool($key))) {
         return $obj;
     }
     if ($con === null) {
         $con = Propel::getConnection(FeaturevectorsegmentPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $criteria = new Criteria(FeaturevectorsegmentPeer::DATABASE_NAME);
     $criteria->add(FeaturevectorsegmentPeer::SEGMENTNR, $segmentnr);
     $criteria->add(FeaturevectorsegmentPeer::TRACK_ID, $track_id);
     $criteria->add(FeaturevectorsegmentPeer::FEATUREVECTORTYPE_ID, $featurevectortype_id);
     $v = FeaturevectorsegmentPeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }