public function delete() { if (Gpf_Application::isDemo() && Gpf_Application::isDemoEntryId($this->getId())) { throw new Gpf_Exception("Demo banner can not be deleted"); } return parent::delete(); }
public function delete($moveChildAffiliates = false) { if (Gpf_Application::isDemo() && Gpf_Application::isDemoEntryId($this->getId())) { throw new Gpf_Exception("Demo affiliate can not be deleted"); } $this->load(); if ($moveChildAffiliates) { $this->moveChildAffiliatesTo($this->getParentUserId()); } else { $this->clearParentAffiliate(); } return parent::delete(); }