Exemplo n.º 1
0
 /**
  * Returns a peer instance associated with this om.
  *
  * Since Peer classes are not to have any instance attributes, this method returns the
  * same instance for all member of this class. The method could therefore
  * be static, but this would prevent one from overriding the behavior.
  *
  * @return     notificationPeer
  */
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new notificationPeer();
     }
     return self::$peer;
 }
 public function save(PropelPDO $con = null)
 {
     $is_new = $this->isNew();
     if ($this->isNew()) {
         $this->setDc(kDataCenterMgr::getCurrentDcId());
     }
     if (self::isEntryNotification($this->getType())) {
         $this->setObjectType(self::NOTIFICATION_OBJECT_TYPE_ENTRY);
     } else {
         $this->setObjectType(self::NOTIFICATION_OBJECT_TYPE_KSHOW);
     }
     $res = parent::save($con);
     // when new object or status is pending - add the indicator for the batch job to start running
     if ($is_new || ($this->getStatus() == self::NOTIFICATION_STATUS_PENDING || $this->getStatus() == self::NOTIFICATION_STATUS_SHOULD_RESEND)) {
         self::addIndicator($this->getId());
     }
     return $res;
 }