/**
  * 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      CcBlockcriteria $value A CcBlockcriteria object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(CcBlockcriteria $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getDbId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
 /**
  * Exclude object from result
  *
  * @param     CcBlockcriteria $ccBlockcriteria Object to remove from the list of results
  *
  * @return    CcBlockcriteriaQuery The current query, for fluid interface
  */
 public function prune($ccBlockcriteria = null)
 {
     if ($ccBlockcriteria) {
         $this->addUsingAlias(CcBlockcriteriaPeer::ID, $ccBlockcriteria->getDbId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Пример #3
0
 public function storeCriteriaIntoDb($p_criteriaData)
 {
     // delete criteria under $p_blockId
     CcBlockcriteriaQuery::create()->findByDbBlockId($this->id)->delete();
     //Logging::info($p_criteriaData);
     //insert modifier rows
     if (isset($p_criteriaData['criteria'])) {
         $critKeys = array_keys($p_criteriaData['criteria']);
         for ($i = 0; $i < count($critKeys); $i++) {
             foreach ($p_criteriaData['criteria'][$critKeys[$i]] as $d) {
                 $field = $d['sp_criteria_field'];
                 $value = $d['sp_criteria_value'];
                 if ($field == 'utime' || $field == 'mtime' || $field == 'lptime') {
                     $value = Application_Common_DateHelper::UserTimezoneStringToUTCString($value);
                 }
                 $qry = new CcBlockcriteria();
                 $qry->setDbCriteria($field)->setDbModifier($d['sp_criteria_modifier'])->setDbValue($value)->setDbBlockId($this->id);
                 if (isset($d['sp_criteria_extra'])) {
                     if ($field == 'utime' || $field == 'mtime' || $field == 'lptime') {
                         $d['sp_criteria_extra'] = Application_Common_DateHelper::UserTimezoneStringToUTCString($d['sp_criteria_extra']);
                     }
                     $qry->setDbExtra($d['sp_criteria_extra']);
                 }
                 $qry->save();
             }
         }
     }
     // insert limit info
     $qry = new CcBlockcriteria();
     $qry->setDbCriteria("limit")->setDbModifier($p_criteriaData['etc']['sp_limit_options'])->setDbValue($p_criteriaData['etc']['sp_limit_value'])->setDbBlockId($this->id)->save();
     // insert repeate track option
     $qry = new CcBlockcriteria();
     $qry->setDbCriteria("repeat_tracks")->setDbModifier("N/A")->setDbValue($p_criteriaData['etc']['sp_repeat_tracks'])->setDbBlockId($this->id)->save();
 }
Пример #4
0
 public function storeCriteriaIntoDb($p_criteriaData)
 {
     // delete criteria under $p_blockId
     CcBlockcriteriaQuery::create()->findByDbBlockId($this->id)->delete();
     //Logging::info($p_criteriaData);
     //insert modifier rows
     if (isset($p_criteriaData['criteria'])) {
         $critKeys = array_keys($p_criteriaData['criteria']);
         for ($i = 0; $i < count($critKeys); $i++) {
             foreach ($p_criteriaData['criteria'][$critKeys[$i]] as $d) {
                 $qry = new CcBlockcriteria();
                 $qry->setDbCriteria($d['sp_criteria_field'])->setDbModifier($d['sp_criteria_modifier'])->setDbValue($d['sp_criteria_value'])->setDbBlockId($this->id);
                 if (isset($d['sp_criteria_extra'])) {
                     $qry->setDbExtra($d['sp_criteria_extra']);
                 }
                 $qry->save();
             }
         }
     }
     // insert limit info
     $qry = new CcBlockcriteria();
     $qry->setDbCriteria("limit")->setDbModifier($p_criteriaData['etc']['sp_limit_options'])->setDbValue($p_criteriaData['etc']['sp_limit_value'])->setDbBlockId($this->id)->save();
 }
 /**
  * Filter the query by a related CcBlockcriteria object
  *
  * @param     CcBlockcriteria $ccBlockcriteria  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return    CcBlockQuery The current query, for fluid interface
  */
 public function filterByCcBlockcriteria($ccBlockcriteria, $comparison = null)
 {
     return $this->addUsingAlias(CcBlockPeer::ID, $ccBlockcriteria->getDbBlockId(), $comparison);
 }