コード例 #1
0
ファイル: BaseTrackForm.class.php プロジェクト: EQ4/smint
 public function saveFeaturevectorList($con = null)
 {
     if (!$this->isValid()) {
         throw $this->getErrorSchema();
     }
     if (!isset($this->widgetSchema['featurevector_list'])) {
         // somebody has unset this widget
         return;
     }
     if (null === $con) {
         $con = $this->getConnection();
     }
     $c = new Criteria();
     $c->add(FeaturevectorPeer::TRACK_ID, $this->object->getPrimaryKey());
     FeaturevectorPeer::doDelete($c, $con);
     $values = $this->getValue('featurevector_list');
     if (is_array($values)) {
         foreach ($values as $value) {
             $obj = new Featurevector();
             $obj->setTrackId($this->object->getPrimaryKey());
             $obj->setFeaturevectortypeId($value);
             $obj->save();
         }
     }
 }
コード例 #2
0
ファイル: BaseDistancejob.php プロジェクト: EQ4/smint
 /**
  * Declares an association between this object and a Featurevector object.
  *
  * @param      Featurevector $v
  * @return     Distancejob The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setFeaturevector(Featurevector $v = null)
 {
     if ($v === null) {
         $this->setTrackId(NULL);
     } else {
         $this->setTrackId($v->getTrackId());
     }
     $this->aFeaturevector = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Featurevector object, it will not be re-added.
     if ($v !== null) {
         $v->addDistancejob($this);
     }
     return $this;
 }
コード例 #3
0
ファイル: BaseFeaturevectorPeer.php プロジェクト: EQ4/smint
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      Featurevector $value A Featurevector object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Featurevector $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = serialize(array((string) $obj->getTrackId(), (string) $obj->getFeaturevectortypeId()));
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }