Exemple #1
0
 /**
  * Returns an array representation of the page
  *
  * @return array  associative array containing all page properties
  */
 public function toArray()
 {
     return array_merge(parent::toArray(), array('action' => $this->getAction(), 'controller' => $this->getController(), 'module' => $this->getModule(), 'params' => $this->getParams(), 'route' => $this->getRoute(), 'reset_params' => $this->getResetParams(), 'encodeUrl' => $this->getEncodeUrl(), 'scheme' => $this->getScheme()));
 }
Exemple #2
0
 /**
  * Checks if the container has the given page
  *
  * @param  Page $page       page to look for
  * @param  bool                 $recursive  [optional] whether to search
  *                                          recursively. Default is false.
  * @return bool                             whether page is in container
  */
 public function hasPage(Page $page, $recursive = false)
 {
     if (array_key_exists($page->hashCode(), $this->_index)) {
         return true;
     } elseif ($recursive) {
         foreach ($this->_pages as $childPage) {
             if ($childPage->hasPage($page, true)) {
                 return true;
             }
         }
     }
     return false;
 }