예제 #1
0
 protected function createOrUpdate(PopInCampaignEvent $event, PopInCampaign $model)
 {
     $con = Propel::getConnection(PopInCampaignTableMap::DATABASE_NAME);
     $con->beginTransaction();
     try {
         if (null !== ($id = $event->getId())) {
             $model->setId($id);
         }
         if (null !== ($start = $event->getStart())) {
             $model->setStart($start);
         }
         if (null !== ($end = $event->getEnd())) {
             $model->setEnd($end);
         }
         if (null !== ($contentSourceType = $event->getContentSourceType())) {
             $model->setContentSourceType($contentSourceType);
         }
         if (null !== ($contentSourceId = $event->getContentSourceId())) {
             $model->setContentSourceId($contentSourceId);
         }
         $model->save($con);
         $con->commit();
     } catch (\Exception $e) {
         $con->rollback();
         throw $e;
     }
     $event->setPopInCampaign($model);
 }
예제 #2
0
 /**
  * Exclude object from result
  *
  * @param   ChildPopInCampaign $popInCampaign Object to remove from the list of results
  *
  * @return ChildPopInCampaignQuery The current query, for fluid interface
  */
 public function prune($popInCampaign = null)
 {
     if ($popInCampaign) {
         $this->addUsingAlias(PopInCampaignTableMap::ID, $popInCampaign->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
예제 #3
0
파일: FrontHook.php 프로젝트: bcbrr/PopIn
 /**
  * Get the session key used to store if a campaign has been seen.
  * @param PopInCampaign $campaign
  * @return string
  */
 protected static function getSeenSessionKeyForPopInCampaign(PopInCampaign $campaign)
 {
     return static::$BASE_SESSION_KEY_CAMPAIGN_SEEN . '.' . $campaign->getId();
 }