Trigger the blog_entries_viewed event.

@param array $filters the parameters used in the filter of get_entries
@return array with status result and warnings
@since  Moodle 3.6
546205
public static function view_entries($filters = array()) {

        $warnings = array();
        $params = self::validate_parameters(self::view_entries_parameters(), array('filters' => $filters));

        list($context, $filters, $courseid, $userid) = self::validate_access_and_filters($params['filters']);

        $eventparams = array(
            'other' => array('entryid' => $filters['entryid'], 'tagid' => $filters['tagid'], 'userid' => $userid,
                'modid' => $filters['cmid'], 'groupid' => $filters['groupid'], 'search' => $filters['search']
            )
        );
        if (!empty($userid)) {
            $eventparams['relateduserid'] = $userid;
        }
        $eventparams['other']['courseid'] = ($courseid === SITEID) ? 0 : $courseid;
        $event = \core\event\blog_entries_viewed::create($eventparams);
        $event->trigger();

        return array(
            'warnings' => $warnings,
            'status' => true,
        );
    }
1030890
private static function get_filter_callbacks( $filter ) {
		global $wp_filter;

		if ( ! isset( $wp_filter[ $filter ] ) ) {
			return false;
		}

		if ( is_a( $wp_filter[ $filter ], 'WP_Hook' ) ) {
			$callbacks = $wp_filter[ $filter ]->callbacks;
		} else {
			$callbacks = $wp_filter[ $filter ];
		}
		if ( is_array( $callbacks ) ) {
			return $callbacks;
		}
		return false;
	}
147823
public function query(array $stream, array $filters = [])
    {
        $qb = QueryBuilder::create((array)$stream);

        foreach ($filters as $key => $value) {
            $qb->addCriterion($key, $value);
        }

        $qb->sortedBy('occurred_on', 'ASC');

        return $qb->getResults();
    }
906829
public function findFiltered(array $filters)
    {
        /* @var Unit[] $units */
        if (!isset($filters['domain']) || is_null($filters['domain']) || empty($filters['domain'])) {
            $units = $this->findAll();
        } else {
            $units = $this->findByDomain($filters['domain']);
        }

        foreach ($units as $k => $u) {
            $filterEmpty = isset($filters['empty']) && $filters['empty'];
            $filterKey = isset($filters['key']) && strlen(trim($filters['key'])) > 0 ? trim($filters['key']) : null;
            $filterValue = isset($filters['value']) && strlen(trim($filters['value'])) > 0 ? trim($filters['value']) : null;
            if (empty($filters['locale'])) {
                $filters['locale'] = $this->getLocaleList();
            }

            if ($filterKey && strpos($u->getKey(), $filterKey) === false) {
                unset($units[$k]);
                continue;
            }

            $nonEmptyCount = 0;
            $valueCount = 0;
            foreach ($u->getTranslations() as $t) {
                // Remove translations not required
                if (!in_array($t->getLocale(), $filters['locale'])) {
                    unset($u[$t->getLocale()]);
                    continue;
                }

                // Count empty or match values
                $value = $t->getValue();
                if ($value !== null && strlen($value) > 0) {
                    ++$nonEmptyCount;
                }
                if ($filterValue && strpos($value, $filterValue) !== false) {
                    ++$valueCount;
                }
            }

            // For empty filtering, remove unit with non empty translations
            if ($filterEmpty && $nonEmptyCount >= count($filters['locale'])) {
                unset($units[$k]);
                continue;
            }

            // For value filtering, remove unit when there is no match
            if ($filterValue && $valueCount == 0) {
                unset($units[$k]);
                continue;
            }
        }

        return $units;
    }
272606
protected function parseImageFilter(array $filters)
    {
        $parameter = [];

        if ('filter' !== array_shift($filters)) {
            return;
        }

        foreach ($filters as $filter) {
            $this->getFilterParams($parameter, $filter);
        }

        return $parameter;
    }
500263
public function withFilters(array $filters = null)
    {
        if ($filters) {
            foreach ($filters as $filter) {
                switch ($filter['type']) {
                    case 'select':
                        $this->select($filter['fields']);
                        break;
                    case 'andWhere':
                        $this->andWhere($filter['field'], $filter['operation'], $filter['value']);
                        break;
                    case 'orWhere':
                        $this->orWhere($filter['field'], $filter['operation'], $filter['value']);
                        break;
                    case 'andHaving':
                        $this->andHaving($filter['field'], $filter['operation'], $filter['value']);
                        break;
                    case 'orHaving':
                        $this->orHaving($filter['field'], $filter['operation'], $filter['value']);
                        break;
                    case 'addGroupBy':
                        $this->addGroupBy($filter['field']);
                        break;
                    case 'addOrderBy':
                        $this->addOrderBy($filter['field'], $filter['order']);
                        break;
                    case 'fkAddOrderBy':
                        $this->fkAddOrderBy($filter['field'], $filter['fkField'], $filter['order']);
                        break;
                    case 'paginate':
                        if (isset($filter['page'])) {
                            $this->paginate($filter['limit'], $filter['page']);
                        } else {
                            $this->paginate($filter['limit']);
                        }
                        break;
                }
            }
        }

        return $this;
    }
70788
public function listing($filters)
	{
		$listing = $this->smalldb->createListing($filters);
		return [
			'items' => array_values($listing->fetchAll()),	// Order of object's properties not guaranteed in JS
			'processed_filters' => $listing->getProcessedFilters(),
		];
	}
558309
public function set($filters)
    {
        if (! is_array($filters)) {
            $filters = func_get_args();
        }

        $this->clear();

        foreach ($filters as $filter) {
            $this->push($filter);
        }

        return $this->getDisplay();
    }
985283
public function getRecords($filters = array())
	{
		$entries = self::all();

		$c = $entries->getTableName();
		$e = '#__extensions';

		$entries
			->select($c . '.*,' . $e . '.name')
			->join($e, $e . '.element', $c . '.component', 'inner')
			->whereEquals($e . '.type', 'component');

		if (isset($filters['component']) && $filters['component'])
		{
			$entries->whereEquals($e . '.element', $filters['component']);
		}

		return $entries
			->ordered($c . '.component', 'asc')
			->rows();
	}
435311
public function setAllowFilters(array $filters = []): void
    {
        $this->allowFilters = [];
        foreach ($filters as $column) {
            $this->addAllowFilter($column);
        }
    }
497941
public function filter(array $filters = array())
    {
        foreach ($filters as $k => $v) {
            if (is_bool($v)) {
                $filters[$k] = $v ? 'true' : 'false';
            }
        }
        return $this->mergeAttributes('filters', $filters);
    }
71963
public function search(array $filters)
    {
        return $this->filter(function (CollectionableInterface $entity) use ($filters) {
            $res = true;
            foreach ($filters as $key => $value) {
                $current = $this->getPropertyAccessor()->getValue($entity, $key);
                $res = $res && (is_array($value) ?
                    in_array($current, $value) :
                    $current == $value
                );
            }

            return $res;
        });
    }
371255
public function setWhereAny($filters)
    {
        $filters = func_num_args() > 1 ? func_get_args() : $filters;
        return $this
            ->setWhere(array())
            ->addWhereAny($filters);
    }
890138
public function setFilters(array $filters)
    {
        $this->filters = $filters;

        $this->updateInternalState();

        $this->handleChangedParameters();

        return $this;
    }
1185634
final public static function countAllObjects($filters = array()) {
	
		$app		= Application::getInstance();
		$db			= Database::getInstance();
		$class		= get_called_class();
		$binds		= $class::getBinds();
	
		$where		= '';
		$conds		= array();
		$whereLog	= '';
	
		if (is_array($filters)) {
				
			// iterate all filters
			foreach ($filters as $property => $value) {
					
				// check if filter is valid and binds really
				if (is_string($property) and strlen($property) and array_key_exists($property, $binds)) {
	
					// gets the table field name
					$field = $binds[$property];
	
					// creates where condition
					$conds[] = '`' . $field . '`' . (is_null($value) ? ' IS NULL' : ' = ' . $db->quote($value));
						
				} else {
						
					trigger_error('In method ' . $class . '::countAllObjects() unexistent property “' . $property . '” can’t be used as filter');
						
				}
					
			}
				
			// log message
			$whereLog .= count($conds) ? ' under condition ' . implode(' AND ', $conds) : '';
				
			// builds where
			$where = count($conds) ? ' WHERE ' . implode(' AND ', $conds) : '';
	
		}

		// runs query
		$db->setQuery('SELECT COUNT(1) FROM `' . $class::TABLE_NAME . '`' . $where);
		$count = $db->loadCount();
	
		$app->logEvent('Counted ' . $count . ' ' . $class . ' objects' . $whereLog);
	
		return $count;
	
	}
1256419
public function list(array $filters = [])
    {
        $data = [
            'filters' => json_encode($filters),
        ];

        $url = $this->url.'?'.http_build_query($data);

        return $this->curl->get($url);
    }
637
public function setFilters($filters)
    {
        if (! is_array($filters))
            $filters = [$filters];

        $this->filters = array_unique(array_merge($this->filters, $filters));

        return $this;
    }