{@inheritDoc}
@param string $qty
@param array $filterComponents
@param int Bitmask fo class constants
@return Bond\Container
540836
public function findByFilterComponents( $qty, array $filterComponents, $source = null )
    {

        $source = $this->findByFilterComponentsSourceSetup( $source );

        $output = $this->makeNewContainer();

        $profiler = new Profiler( __FUNCTION__ );
        $profiler->log("setup");

        if( $source & self::UNPERSISTED ) {
            $output->add( $this->findByFilterComponentsMultiton( $filterComponents, $source ) );
        }
        $profiler->log("multiton");

        if( $source & self::PERSISTED ) {

            $cannotMatch = function ($entity) {
                return $entity instanceof Base ? $entity->isNew() : false;
            };

            // If all of the filter components can't match - that is return true - there isn't any point in going to the db
            $checkDatabase = !\Bond\array_check(
                function( $filterComponent ) use ( $cannotMatch ) {
                    return $filterComponent->getCannotMatch( $cannotMatch );
                },
                $filterComponents,
                false // if you don't have any filtering you always want to check the db
            );

            if( $checkDatabase ) {
                $output->add( $this->findByFilterComponentsDatabase( $filterComponents, $source ) );
            }

        }
        $profiler->log("database");

        return $this->findByFilterComponentsFormatReturnValue( $qty, $output );

    }
475616
protected function applyFilters(&$propertyData, array $filterClasses)
    {
        /** @var FilterInterface $filter */
        foreach ($filterClasses as $filterClass => $filterClassArguments) {
            $filter = new $filterClass(...$filterClassArguments);
            $propertyData = $filter->apply($propertyData);
        }
        
        return $propertyData;
    }
688227
public function mergeFilter($filters, $glue='and') {
		$crit = array();
		$params = array();
		if ($filters) {
			foreach($filters as $filter) {
				$crit[] = array_shift($filter);
				$params = array_merge($params,$filter);
			}
			array_unshift($params,'( '.implode(' ) '.$glue.' ( ',$crit).' )');
		}
		return $params;
	}
532788
protected function getFilterFromData($data): FilterInterface
    {
        if (($groupAndData = $this->getArrayValue($data, 'and')) !== null) {
            $group = new GroupAndFilter();
            foreach ($groupAndData as $filter) {
                $group->push($this->getFilterFromData($filter));
            }

            return $group;
        }
        if (($groupOrData = $this->getArrayValue($data, 'or')) !== null) {
            $group = new GroupOrFilter();
            foreach ($groupOrData as $filter) {
                $group->push($this->getFilterFromData($filter));
            }

            return $group;
        }

        // No group filter; must be a regular Filter
        $field = $this->getArrayValue($data, 'f');
        return new Filter($field, $this->getArrayValue($data, 'o'), $this->getArrayValue($data, 'd'));
    }
297297
public function getFilterBagFromExpression($filtersExpression)
    {
        $parser = new Parser($filtersExpression);
        $filtersAST = $parser->getAST();

        $filterBag = new FilterBag();
        $filterBag->set('filter_' . md5($filtersExpression), $filtersAST);

        return $filterBag;
    }
984448
protected function marshall(QtiComponent $component)
    {
        $element = static::getDOMCradle()->createElement($component->getQtiClassName());

        $this->setDOMElementAttribute($element, 'mapKey', $component->getMapKey());
        $this->setDOMElementAttribute($element, 'mappedValue', $component->getMappedValue());
        
        if (Version::compare($this->getVersion(), '2.0.0', '>') === true) {
            $this->setDOMElementAttribute($element, 'caseSensitive', $component->isCaseSensitive());
        }

        return $element;
    }
1188306
protected function marshall(QtiComponent $component)
    {
        $version = $this->getVersion();
        $element = $this->createElement($component);
        $this->setDOMElementAttribute($element, 'identifier', $component->getIdentifier());

        if ($component->isFixed() === true) {
            $this->setDOMElementAttribute($element, 'fixed' , true);
        }

        if (Version::compare($version, '2.1.0', '>=') === true && $component->hasTemplateIdentifier() === true) {
            $this->setDOMElementAttribute($element, 'templateIdentifier', $component->getTemplateIdentifier());
        }

        if (Version::compare($version, '2.1.0', '>=') === true && $component->getShowHide() === ShowHide::HIDE) {
            $this->setDOMElementAttribute($element, 'showHide', ShowHide::getNameByConstant(ShowHide::HIDE));
        }

        if (Version::compare($version, '2.1.0', '>=') === true && $component->isRequired() === true) {
            $this->setDOMElementAttribute($element, 'required', true);
        }
        
        if (Version::compare($version, '2.1.0', '<') === true) {
            $matchGroup = $component->getMatchGroup();
            if (count($matchGroup) > 0) {
                $this->setDOMElementAttribute($element, 'matchGroup', implode(' ', $matchGroup->getArrayCopy()));
            }
        }

        $this->fillElement($element, $component);

        return $element;
    }
358741
public function attachFiltersToManager(Filter $filterManager, Application $app)
    {
        $stripOnVisibility = new StripOnVisibility($app['descriptor.builder']);
        $filtersOnAllDescriptors = array(
            new StripInternal($app['descriptor.builder']),
            new StripIgnore($app['descriptor.builder'])
        );

        foreach ($filtersOnAllDescriptors as $filter) {
            $filterManager->attach('phpDocumentor\Descriptor\ConstantDescriptor', $filter);
            $filterManager->attach('phpDocumentor\Descriptor\FunctionDescriptor', $filter);
            $filterManager->attach('phpDocumentor\Descriptor\InterfaceDescriptor', $filter);
            $filterManager->attach('phpDocumentor\Descriptor\TraitDescriptor', $filter);
            $filterManager->attach('phpDocumentor\Descriptor\PropertyDescriptor', $filter);
            $filterManager->attach('phpDocumentor\Descriptor\MethodDescriptor', $filter);
        }

        $filterManager->attach('phpDocumentor\Descriptor\PropertyDescriptor', $stripOnVisibility);
        $filterManager->attach('phpDocumentor\Descriptor\MethodDescriptor', $stripOnVisibility);

        return $filterManager;
    }
1357343
public function applyFilters(BinaryInterface $binary, array $config): BinaryInterface
    {
        if ($binary instanceof FileBinaryInterface) {
            $image = $this->imagine->open($binary->getPath());
        } else {
            $image = $this->imagine->load($binary->getContent());
        }

        foreach ($this->sanitizeFilters($config['filters'] ?? []) as $name => $options) {
            $prior = $image;
            $image = $this->loaders[$name]->load($image, $options);

            if ($prior !== $image) {
                $this->destroyImage($prior);
            }
        }

        return $this->exportConfiguredImageBinary($binary, $image, $config);
    }
953525
public static function make($filterName)
    {
        if (self::$validator && !self::$validator->validate($filterName)) {
            return null;
        }

        if (self::$transformer) {
            $class = __NAMESPACE__ . '\\' . self::$transformer->transform($filterName);
        } else {
            $class = __NAMESPACE__ . '\\' . $filterName;
        }

        if (!class_exists($class)) {
            return null;
        }

        return new $class();
    }
371760
public function setFilterable(array $filterable): Repository
	{
		if ($filterable === self::ALLOW_ALL) {
			$this->filterable = self::ALLOW_ALL;

			return $this;
		}

		// Reset filterable
		$this->filterable = [];

		foreach ($filterable as $allowed_field) {
			$this->filterable[$allowed_field] = true;
		}

		return $this;
	}
1227290
public function applyFiltersToRepository(
        array $filters,
        FilterFactory $filterFactory,
        ConditionAwareRepository $repository
    )
    {
        if (empty($filters) && ($defaultFilter = $filterFactory->getDefaultFilter()) !== null) {
            $filters = ['default' => $defaultFilter];
        }

        foreach ($filters as $filterName => $filterValues) {
            try {
                $filter = $filterFactory->make($filterName, $filterValues);
            } catch (FilterFactoryNotFoundException $e) {
                continue;
            }

            $repository->applyCondition($filter);
        }
    }
122475
public function filters($ext, $filters = null)
    {
        if ($filters === null) {
            if (isset($this->_data[$ext][self::FILTERS])) {
                return $this->_data[$ext][self::FILTERS];
            }
            return [];
        }
        $this->_data[$ext][self::FILTERS] = $filters;
    }
570487
public function make($data, $filters, $recursive = true)
	{
		$this->data 		= $data;
		$this->filters 		= $this->explodeFilters($filters);
		$this->recursive 	= $recursive;
		$this->filteredData	= array();

		return $this;
	}
271259
protected function buildProductVariation(
        array &$productData,
        $sku,
        $qty,
        $ean,
        array $images = [],
        array $specifications = []
    ) {
        $transformer = new Create($sku, $qty, $ean, $images, $specifications);
        $output      = $transformer->output();

        $productData['variations'][] = $output['variation'];

        return $productData;
    }
772756
public function findAllByFiltersKeys(array $filtersKeys)
    {
        $qb = $this->entityManager->getRepository($this->class)->createQueryBuilder('m');

        $filters = array();
        $addNull = false;
        $inversedfilters = array();
        foreach ($filtersKeys as $filter) {
            if ($this->filter->has($filter)) {
                $value = $this->filter->get($filter);
                $inversedfilters[$value] = $filter;

                if ($value === null) {
                    $addNull = true;
                } else {
                    $filters[] = $value;
                }
            }
        }

        if ($addNull === false && empty($filters)) {
            return array();
        }

        if (!empty($filters)) {
            $qb
                ->select('m')
                ->where($qb->expr()->in('m.filter', $filters))
                ;
        }

        if ($addNull === true) {
            $qb->orWhere('m.filter IS NULL');
        }

        $medias = $qb->orderBy('m.createdAt', 'DESC')
            ->getQuery()
            ->getResult()
            ;

        foreach ($medias as $media) {
            $media->setCryptedFilter($inversedfilters[$media->getFilter()]);
        }

        return $medias;
    }
8630
public function useFilterArray(array $filterArray)
    {
        foreach ($filterArray as $key => $additionalFilter) {
            $this->useFilter($additionalFilter, $key);
        }

        return $this;
    }