Get the General special links array for a role
@param array|string $filter A list of the roles to include in the result.  If no filter is specified all roles are returned.
@param bool $sort True if the result list should be sorted
@return array
494202
public function &getNonDimensionalRoleRefs( $filter = array(), $sort = true )
	{
		// Make sure the filter is initialized and contains lowercase values
		if ( ! is_array( $filter ) ) $filter = array();
		$filter = array_flip( array_map( 'strtolower', $filter ) );

		$refs = $this->context->nonDimensionalRoleRefs;

		/**
		 * @var array $result
		 */
		$result = array();

		foreach ( $refs as $refKey => $ref )
		{
			// Apply the filter if one is provided
			if ( count( $filter ) && ! isset( $filter[ strtolower( $refKey ) ] ) ) continue;

			$result[ $refKey ] = $this->context->nonDimensionalRoleRefs[ $refKey ];
			foreach ( $result[ $refKey ] as $arcroleKey => $arcrole )
			{
				// If the acrole type is defined, get the cycles allowed otherwise set it to be 'none'
				$arcRoleTaxonomy = $this->getTaxonomyForXSD( $arcrole['href'] );
				$arcRoleRefs = $arcRoleTaxonomy ? $arcRoleTaxonomy->getArcroleTypes() : false;
				if ( $arcRoleRefs && isset( $arcRoleRefs['link:definitionArc'][ $arcroleKey ] ) )
				{
					$arcRoleRef = $arcRoleRefs['link:definitionArc'][ $arcroleKey ];
					$result[ $refKey ][ $arcroleKey ]['text'] = isset( $arcRoleRef['description'] ) ? $arcRoleRef['description'] : "";
					$result[ $refKey ][ $arcroleKey ]['cyclesAllowed'] = isset( $arcRoleRef['cyclesAllowed'] ) ? $arcRoleRef['cyclesAllowed'] : "none";
				}
				else
				{
					$result[ $refKey ][ $arcroleKey ]['text'] = "";
					$result[ $refKey ][ $arcroleKey ]['cyclesAllowed'] = "none";
				}

				// Add the description
				$description = $arcRoleTaxonomy->getNonDimensionalArcRoleDescription( $arcroleKey );
				$result[ $refKey ][ $arcroleKey ]['text'] = $description ? $description : "";

				// Remove any prohibited arcs
				if ( isset( $result[ $refKey ][ $arcroleKey ]['arcs'] ) && count( $result[ $refKey ][ $arcroleKey ]['arcs'] ) )
				{
					$arcs =& $result[ $refKey ][ $arcroleKey ]['arcs'];
					foreach ( $arcs as $from => $targets )
					{
						foreach ( $targets as $to => $node )
						{
							if ( $node['use'] == XBRL_Constants::$xlinkUseOptional ) continue;
							unset( $arcs[ $from ][ $to ] );
						}

						if ( count( $arcs[ $from ] ) ) continue;
						unset( $arcs[ $from ] );
					}
				}
			}

			if ( $sort )
			{
				$this->sortRoleRefs( $result[ $refKey ] );
			}

		}

		return $result;
	}
1166107
public function getData(array $arr, $filter = null)
    {
        $data = [];
        foreach ($arr as $val) {
            $data[$val] = $this->body->{$val};
            if ($filter) {
                $data[$val] = Filter::factory($data[$val], $filter);
            }
        }
        return $data;
    }
871916
protected function getAnswerModel(array $filter, array $data, $sort)
    {
        $exportModelSource = $this->loader->getExportModelSource('AnswerExportModelSource');
        $model = $exportModelSource->getModel($filter, $data);
        $noExportColumns = $model->getColNames('noExport');
        foreach($noExportColumns as $colName) {
            $model->remove($colName, 'label');
        }
        $model->applyParameters($filter, true);

        $model->addSort($sort);

        return $model;
    }
357876
public function usersList(array $filter = [], $page = null, $limit = null)
    {
        $parameters = [];

        if (count($filter)) {
            $parameters['filter'] = $filter;
        }
        if (null !== $page) {
            $parameters['page'] = (int)$page;
        }
        if (null !== $limit) {
            $parameters['limit'] = (int)$limit;
        }

        /** @noinspection PhpUndefinedMethodInspection */
        return $this->client->makeRequest(
            '/users',
            "GET",
            $parameters
        );
    }
1109326
public function filter($filter)
    {
        if (is_array($filter) != true) {
            $filter = [$filter];
        }

        foreach ($filter as $item) {
            $this->filters[] = str_replace('./', $this->outpath . '/', $item);
        }

        return $this;
    }
310717
public function select(array $filter, array $sorting = [])
    {
        $this->filter = $filter;
        $this->sorting = $sorting;
        $this->prefetch = false;
        $this->items = null;

        return $this;
    }
1305055
protected function filterContainsEmail($filter)
    {
        $return = [];

        if (
            (isset($filter->string) && filter_var($filter->string, FILTER_VALIDATE_EMAIL))
            || false !== strpos(serialize($filter), 'email')
        ) {
            $return = ['l.email'];
        }

        return $return;
    }
753024
public function listResources($filter)
    {
        $alias = 'resource';
        $collection = $this->getThisCollection();

        $queryBuilder = $this->getRepository()
            ->createQueryBuilder($alias);

        // Build the filter on resources
        $this->filterQueryBuilder($queryBuilder, $filter, $collection, $alias);

        // Count the total number of resources
        $countQueryBuilder = clone $queryBuilder;
        $collectionIdentifier = $collection->getIdentifier();
        $totalNumberOfRows = $countQueryBuilder
            ->select($countQueryBuilder->expr()->count($alias . '.' . $collectionIdentifier))
            ->getQuery()
            ->getSingleScalarResult();

        // Paginate resources
        $this->paginateQueryBuilder($queryBuilder, $filter);

        // Finally, select all fields
        $queryBuilder->select($alias);

        $returnedResources = $this->loadResourcesFromQueryBuilder($queryBuilder, $this->getThisCollection());

        return Resource::formatResourcesJsonApi($returnedResources, $totalNumberOfRows);
    }
883981
public function getAll(array $filter)
    {
        $this->select = $this->readSql->select('history');
                    
        $this->joinAuth()->joinAclRole();
        
        $this->filter($filter)->sort($filter); 

        if (array_key_exists('pagination', $filter)) {
            if ($filter['pagination'] == 'off') {  
                return $this->getRows();    
            }
        }

        return $this->getPaginator();
    }
365006
public function getFilter($filter)
    {
        $result = null;

        if(isset($this->__filters[$filter])) {
            $result = $this->__filters[$filter];
         }

        return $result;
    }
585427
private function tempFilters($filter)
    {
        $f = $filter[1];
        $elements = explode('\'', $f);

        // Hack to make "dot" works on filters
        for ($i=0, $m=0; $i<count($elements); $i++) {
            if ($m%2 == 0) {
                if ($i > 0 && substr($elements[$i-1], 0, 1) == '\\') {
                    continue;
                }

                $e = explode('.', $elements[$i]);
                $str = ''; $first = true;
                foreach ($e as $substr) {
                    if ($first) {
                        $str = $substr;
                        $first = false;
                        continue;
                    }

                    $end = null;
                    if (false !== $pos = $this->strpos_array($substr, $this->keywords)) {
                        list($substr, $end) = array(substr($substr, 0, $pos), substr($substr, $pos, strlen($substr)));
                    }

                    $str .= '[' . $substr . ']';
                    if (null !== $end) {
                        $str .= $end;
                    }
                }
                $elements[$i] = $str;
            }

            $m++;
        }

        return "[#" . (array_push($this->result, implode('\'', $elements)) - 1) . "]";
    }
954947
public function get_filter_values($filter) {
        if ($allvalues = (array) $this->get_config('filtervalues')) {
            if (isset($allvalues[$filter])) {
                return $allvalues[$filter];
            }
        }

        return [];
    }
511569
public function all($filter)
    {
        $result = $this->toArray();

        // If the value is null return the default
        if(!empty($result))
        {
            // Handle magic quotes compatibility
            if (get_magic_quotes_gpc()) {
                $result = $this->_stripSlashes( $result );
            }

            // Filter the data
            if(!($filter instanceof FilterInterface)) {
                $filter = $this->getObject('filter.factory')->createChain($filter);
            }

            $result = $filter->sanitize($result);
        }

        return $result;
    }
143189
protected function getFilterResolver(string $filter): array
    {
        $class = $filter;
        $method = 'filter';

        $position = \strpos($filter, '@');

        if ($position === 0) {
            $method = 'filter'.\ucwords(\substr($filter, 1));

            return [$this, $method];
        }

        if ($position !== false) {
            list($class, $method) = \explode('@', $filter, 2);
        }

        return $this->makeFilterResolver($class, $method);
    }
620668
public function getMethods($filter = null)
    {
        if ($this->methods === null) {
            // lazy load class methods list
            $this->methods = array();
            foreach ($this->node->stmts as $stmt) {
                if ($stmt instanceof Node\Stmt\ClassMethod) {
                    $stmt->setAttribute('fileName', $this->getFileName());
                    $this->methods[$stmt->name] = new MethodModel($this, $stmt);
                }
            }
        }

        if (isset($filter)) {
            // @TODO must implement the filter feature
            $methods =& $this->methods;
        } else {
            $methods =& $this->methods;
        }

        return array_values($methods);
    }
1273478
public function getChannels($filter = null)
	{
		$channels = array();

		// Create the request
		$request = new client\Request('/api/channel/grid');
		
		if ($filter)
			$request->setFilter($filter);
		
		// Get the response
		$response = $this->_client->getResponse($request);
		$rawContent = $response->getContent();

		$content = json_decode($rawContent);

		foreach ($content->entries as $entry)
			$channels[] = model\Channel::fromRawEntry($entry);

		return $channels;
	}
737165
protected function getPredicatesFromFilterCondition($filter)
    {
        $predicates = [];
        $regex = "/(^|\b)(\w+\:\w+)\.(l|u)(\b|$)/";
        foreach($filter as $key=>$condition)
        {
            if(is_string($key))
            {
                $numMatches = preg_match_all($regex, $key, $matches);
                for($i = 0; $i < $numMatches; $i++)
                {
                    if(isset($matches[2][$i]))
                    {
                        $predicates[] = $matches[2][$i];
                    }
                }
            }
            if(is_string($condition))
            {
                $numMatches = preg_match_all($regex, $condition, $matches);
                for($i = 0; $i < $numMatches; $i++)
                {
                    if(isset($matches[2][$i]))
                    {
                        $predicates[] = $matches[2][$i];
                    }
                }
            }
            elseif(is_array($condition))
            {
                array_merge($predicates, $this->getPredicatesFromFilterCondition($condition));
            }
        }
        return $predicates;
    }