/**
  *
  * Set Forum
  *
  * @param  Forum    $forum
  * @return Category
  */
 public function setForum(ConcreteForum $forum = null)
 {
     if ($this->forum) {
         if ($forum) {
             if ($this->forum->getId() != $forum->getId()) {
                 $this->setListOrderPriority(count($forum->getCategories()) + 1);
             }
         } else {
             $this->setListOrderPriority(0);
         }
     } else {
         if ($forum) {
             $this->setListOrderPriority(count($forum->getCategories()) + 1);
         } else {
             $this->setListOrderPriority(0);
         }
     }
     $this->forum = $forum;
     return $this;
 }
Example #2
0
 /**
  *
  * @access public
  */
 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->readAuthorisedRoles = array();
 }