Esempio n. 1
0
 /**
  * Before saving - if new moderation - update the moderation count
  */
 public function save(PropelPDO $con = null)
 {
     if ($this->getObjectType() == self::MODERATION_OBJECT_TYPE_ENTRY) {
         $entry = $this->getObject();
         if ($entry) {
             $entry->setModerationStatus($this->getStatus());
             $entry->save();
         }
     }
     $res = parent::save($con);
     return $res;
 }
Esempio n. 2
0
 /**
  * Before saving - if new moderation - update the moderation count
  */
 public function save(PropelPDO $con = null)
 {
     if ($this->getObjectType() == self::MODERATION_OBJECT_TYPE_ENTRY) {
         $entry = $this->getObject();
         if ($entry) {
             if ($this->isNew()) {
                 // a new moderation - update the moderation_count of the entry
                 $entry->incModerationCount();
             }
             // whether new or not - update the moderation_status of the entry to be the current status
             // TODO - decide what status should effect the entry !!
             $entry->setModerationStatus($this->getStatus());
             $entry->save();
         } else {
             // Big problem !
         }
     }
     $res = parent::save($con);
     return $res;
 }
Esempio n. 3
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     moderationPeer
  */
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new moderationPeer();
     }
     return self::$peer;
 }