Beispiel #1
0
 /**
  * Class constructor.
  *
  * @param  string|null          $uid                The unique identifier of the section.
  * @param  array|null           $options            Initial options for the section:
  *                                                              - page      the associated page
  *                                                              - site      the owning site
  */
 public function __construct($uid = null, $options = null)
 {
     parent::__construct($uid, $options);
     if (is_array($options) && array_key_exists('page', $options) && $options['page'] instanceof Page) {
         $this->setPage($options['page']);
     } else {
         $this->setPage(new Page($this->getUid(), ['title' => 'Untitled', 'main_section' => $this]));
     }
     if (is_array($options) && array_key_exists('site', $options) && $options['site'] instanceof Site) {
         $this->setSite($options['site']);
     }
     $this->_pages = new ArrayCollection();
 }
Beispiel #2
0
 /**
  * Class constructor.
  *
  * @param string $uid The unique identifier of the keyword
  */
 public function __construct($uid = null)
 {
     parent::__construct($uid);
     $this->_content = new ArrayCollection();
 }