/** * {@inheritdoc} */ public function accept() { if (!isset($this->options['access']) or !$this->options['access']) { return true; } return $this['user']->hasAccess(parent::current()->getAccess()); }
/** * {@inheritdoc} */ public function accept() { $item = parent::current(); if ($active = $item->getAttribute('active') and is_string($active)) { $active = (bool) preg_match('#^' . str_replace('*', '.*', $active) . '$#', $this->route); $item->setAttribute('active', $active); if ($active) { while ($item->getParentId() && ($item = $item->getMenu()->getItem($item->getParentId()))) { $item->setAttribute('active', $active); } } } return true; }
/** * Constructor. * * @param FilterManager $filters */ public function __construct(FilterManager $filters = null) { $this->filters = $filters ?: new FilterManager(); FilterIterator::setApplication($this->getApplication()); }
/** * Constructor. * * @param \Iterator $iterator * @param array $options */ public function __construct(\Iterator $iterator, array $options = []) { parent::__construct($iterator); $this->options = $options; }