/** * 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; }
/** * 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; }