Filters events that pass all contained filters.

@param \Phergie\Irc\Event\EventInterface $event
@return boolean|null TRUE if the event passes all contained filters, FALSE
if it fails any filter, or NULL if all filters return NULL.
502322
public function filter(EventInterface $event)
    {
        $output = null;
        foreach ($this->filters as $filter) {
            $result = $filter->filter($event);
            if ($result === false) {
                return false;
            }
            if ($result === true) {
                $output = true;
            }
        }
        return $output;
    }
253831
public function onEvent(Event $event): void
    {
        if (!$event instanceof GetResponseEvent || !$this->injected) {
            if (null !== ($filter = $this->getFilter())) {
                $this->injectParameters($filter);
            }
        }
    }
913138
public function hasListener($event): bool
    {
        $name = $this->getEventName($event);

        if (isset($this->listeners[$name])) {
            foreach ($this->listeners[$name] as $listeners) {
                if (count($listeners) > 0) {
                    return true;
                }
            }
        }

        unset($name);

        return false;
    }
692222
public function add(EventInterface $event)
    {
        $index = $this->computeIndex($event);
        if (isset($this->events[$index])) {
            $this->events[$index][] = $event;
        } else {
            $this->events[$index] = array($event);
        }

        ++$this->count;
    }
1015023
public function beforeFilter(Event $event) {
		// Check security component loaded and disable it for this plugin:
		if (isset($this->Security)) {
			$this->Security->setConfig('validatePost', false);
			$this->Security->setConfig('unlockedActions', ['save']);
		}

		if (isset($this->Csrf) && $this->request->getAttribute('params')['action'] === 'save') {
			$this->getEventManager()->off($this->Csrf);
		}

		if (Configure::read('Feedback')) {
			return null;
		}

		// Throw error, config file required
		throw new NotFoundException('No Feedback config found.');
	}
1305987
public function deleteFromCache(EventInterface $event) {
        $request = $event->getRequest();
        $cacheDir = $this->getCacheDir($request->getUser(), $request->getImageIdentifier());

        if (is_dir($cacheDir)) {
            $this->rmdir($cacheDir);
        }
    }
632599
protected function _identifierFilter(Event $event) {
		if (is_array($this->_config['identifiers'])) {
			$identifier = $event->getData('entity.model');
			if (!in_array($identifier, $this->_config['identifiers'])) {
				return false;
			}
		}

		return true;
	}
728300
public function onInsert(EventInterface $event)
    {
        $values = $event->getParam('values');

        $now = new DateTime();
        $now = $now->format('Y-m-d h:i:s');

        $values['created_at'] = $now;
        $values['last_updated_at'] = $now;

        $event->setParam('values', $values);
    }
1345350
public function delete(EventInterface $event) {
        $event->getManager()->trigger('db.metadata.delete');
        $event->getResponse()->setModel(new Model\Metadata());
    }
543875
private function evaluateGuard(EventInterface $event)
    {
        foreach ((array) $this->guardEvaluators as $guardEvaluator) {
            $result = call_user_func([$guardEvaluator, 'evaluate'], $event, $this->getPayload(), $this);
            if (!$result) {
                return false;
            }
        }

        return true;
    }
639645
public function getFilter(GetFilterEvent $event): void
    {
        $filter = $this->buildSharingFilter($event);
        $filter = $this->buildOwnerFilter($event, $filter);

        $event->setFilterConstraint($filter);
    }
316771
public function handle(EventInterface $event)
    {
        $events = array_filter($this->listener, function (string $eventName) use ($event): bool {
            return fnmatch($eventName, $event->getName());
        }, ARRAY_FILTER_USE_KEY);

        $events = array_reduce($events, 'array_merge', []);

        array_walk(
            $events,
            /**
             * @param mixed $item
             * @return void
             */
            function ($item) use ($event) {
                if ($item instanceof ListenerInterface) {
                    $item->handle($event);

                    return;
                }
                if (\is_callable($item)) {
                    $item($event);
                }
            }
        );
    }
1041035
public function redirectIt(EventInterface $event)/*# : bool */
    {
        /* @var ResultInterface $result */
        $result = $event->getParam('result');

        if (!isset($_SERVER['HTTPS'])) {
            $result->setStatus(Status::MOVED_PERMANENTLY);
            return false;
        }
        return true;
    }
1014098
public function process(EventInterface $event)
    {
        $events = $this->getEventManager();
        $mapper = $this->getMapper();
        $optionsProvider = $this->getOptionsProvider();
        $translator = $this->getTranslator();
        $pane = $event->getParam('pane');
        if (! $optionsProvider->hasIdentifier($pane)) {
            return;
        }
        $ids = $event->getParam('id');
        if (empty($ids)) {
            return;
        }
        $options = $optionsProvider->getOptions($pane);
        if ($options->getRoot() == 'site') {
            $this->error(self::DeleteFromSite);
            return $this->redirect($event);
        }
        foreach ($ids as $id) {
            try {
                $mapper->beginTransaction();
                $tid = $mapper->getTransactionIdentifier();
                $events->trigger(
                    __FUNCTION__ . '.delete.pre',
                    null,
                    [
                        'content' => $id,
                        'tid' => $tid,
                    ]
                );
                $mapper->delete($id, $tid);
                $mapper->commit();
            } catch (UnavailableSourceException $e) {
                $mapper->rollBack();
                $this->setValue($id)->error(self::SourceNotFound);
            } catch (Exception $e) {
                if (DEBUG_MODE) {
                    throw new DebugException(
                        $translator->translate('Error: ') . $e->getMessage(),
                        $e->getCode(),
                        $e
                    );
                }
                $meta = $mapper->findMetaById($id);
                $name = isset($meta['title']) ? $meta['title'] : $id;
                $this->setValue($name)->error(self::UnexpectedError);
            }
        }

        return $this->redirect($event, 'sc-admin/file/delete');
    }
1217017
public function isMatch(Event $event)
    {
        if (is_callable($this->checker)) {
            return call_user_func($this->checker, $event);
        }
        return false;
    }
388847
public function loadImages(EventInterface $event) {
        $query = $this->getImagesQuery();
        $params = $event->getRequest()->query;
        $returnMetadata = false;

        if ($params->has('page')) {
            $query->page($params->get('page'));
        }

        if ($params->has('limit')) {
            $query->limit($params->get('limit'));
        }

        if ($params->has('metadata')) {
            $query->returnMetadata($params->get('metadata'));
            $returnMetadata = true;
        }

        if ($params->has('from')) {
            $query->from($params->get('from'));
        }

        if ($params->has('to')) {
            $query->to($params->get('to'));
        }

        if ($params->has('sort')) {
            $sort = $params->get('sort');

            if (is_array($sort)) {
                $query->sort($sort);
            }
        }

        if ($params->has('ids')) {
            $ids = $params->get('ids');

            if (is_array($ids)) {
                $query->imageIdentifiers($ids);
            }
        }

        if ($params->has('checksums')) {
            $checksums = $params->get('checksums');

            if (is_array($checksums)) {
                $query->checksums($checksums);
            }
        }

        if ($params->has('originalChecksums')) {
            $checksums = $params->get('originalChecksums');

            if (is_array($checksums)) {
                $query->originalChecksums($checksums);
            }
        }

        if ($event->hasArgument('users')) {
            $users = $event->getArgument('users');
        } else {
            $users = $event->getRequest()->getUsers();
        }

        $response = $event->getResponse();
        $database = $event->getDatabase();

        // Create the model and set some pagination values
        $model = new Model\Images();
        $model->setLimit($query->limit())
              ->setPage($query->page());

        $images = $database->getImages($users, $query, $model);
        $modelImages = [];

        foreach ($images as $image) {
            $entry = new Model\Image();
            $entry->setFilesize($image['size'])
                  ->setWidth($image['width'])
                  ->setHeight($image['height'])
                  ->setUser($image['user'])
                  ->setImageIdentifier($image['imageIdentifier'])
                  ->setChecksum($image['checksum'])
                  ->setOriginalChecksum(isset($image['originalChecksum']) ? $image['originalChecksum'] : null)
                  ->setMimeType($image['mime'])
                  ->setExtension($image['extension'])
                  ->setAddedDate($image['added'])
                  ->setUpdatedDate($image['updated']);

            if ($returnMetadata) {
                $entry->setMetadata($image['metadata']);
            }

            $modelImages[] = $entry;
        }

        // Add images to the model
        $model->setImages($modelImages);

        if ($params->has('fields')) {
            $fields = $params->get('fields');

            if (is_array($fields)) {
                $model->setFields($fields);
            }
        }

        $lastModified = $database->getLastModified($users);

        $response->setModel($model)
                 ->setLastModified($lastModified);
    }
401054
public function containsEvent(EventInterface $event)
    {
        return
            $event->containsPeriod($this) ||
            $event->isDuring($this) ||
            $this->contains($event->getBegin()) ||
            ($event->getEnd() && $this->contains($event->getEnd())  && $event->getEnd()->format('c') !== $this->begin->format('c'))
        ;
    }