public function store()
 {
     try {
         $this->params["type"] = "post";
         parent::store();
     } catch (Exception $e) {
         throw $e;
     }
 }
Example #2
0
 /**
  * getter na record
  * @return DiscussionsRecord
  */
 public function getRecord()
 {
     try {
         if ($this->record instanceof DiscussionsRecord) {
             return $this->record;
         }
         $pageID = LBoxConfigManagerStructure::getInstance()->getPageByUrl(LBOX_REQUEST_URL_VIRTUAL)->id;
         $locationURL = $this->getLocationUrlParam();
         $discussions = new DiscussionsRecords(array("pageId" => $pageID), array("lft" => 1), array(0, 1));
         if ($discussions->count() < 1) {
             // pokud diskuze nebyla nalezena, vytvorime ji a vratime
             $discussion = new DiscussionsRecord();
             $discussion->pageId = $pageID;
             $discussion->urlParam = $locationURL;
             $discussion->store();
         } else {
             $discussion = $discussions->current();
         }
         $discussion->setOutputFilter(new OutputFilterDiscussionRecord($discussion));
         return $this->record = $discussion;
     } catch (Exception $e) {
         throw $e;
     }
 }