Esempio n. 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);
 }
Esempio n. 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;
 }
Esempio n. 3
0
 /**
  * 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();
 }