Пример #1
0
 /**
  * Get raw navigation entities from the database, validate them and transform to the navigation elements.<b/>
  * Filtered by filter(s) or parent ID.<b/>
  * Ordered by 'culumn:direction'.
  *
  * @param string|array|integer $filterOrPid Filter or parent ID.
  * @param string $order_by Order by column in the database 'id:asc' or 'id:desc'.
  *
  * @return NavbarDataProcessor
  */
 public function prepare($filterOrPid = null, $order_by = null)
 {
     if (!$order_by) {
         $order_by = $this->config->order_by;
     }
     $this->entities = $this->validate($this->data->getRawNavbarEntities($filterOrPid, $order_by));
     $this->elements = $this->elements($this->getValidPid($filterOrPid));
     return $this;
 }
Пример #2
0
 /**
  * Get raw Navbars data from the DB. All or by tag. Ordered by title, position or model default.
  *
  * @param  mixed  $tagOrPid  Tag(s) that group navbars.
  * @param  string  $titled  Order direction for ordering by title 'asc' or 'desc'.
  * @param  string  $positioned  Order direction for ordering by position 'asc' or 'desc'.
  * @return NavbarDataProcessor
  */
 public function prepare($tagOrPid = null, $titled = null, $positioned = null)
 {
     if (!$titled) {
         $titled = $this->config->titled;
     }
     if (!$positioned) {
         $positioned = $this->config->positioned;
     }
     $this->entities = $this->validate($this->data->getRawNavbarEntities($tagOrPid, $titled, $positioned));
     $this->elements = $this->elements($this->byPid($tagOrPid));
     return $this;
 }