add has-conditional filter to next find call
@param string $key
@param array $filter
@param null $options
@return $this
519018
public function has($key, $filter, $options = null) {
		if (is_string($filter))
			$filter=array($filter);
		if (is_int(strpos($key,'.'))) {
			list($key,$fkey) = explode('.',$key,2);
			if (!isset($this->hasCond[$key.'.']))
				$this->hasCond[$key.'.'] = array();
			$this->hasCond[$key.'.'][$fkey] = array($filter,$options);
		} else {
			if (!isset($this->fieldConf[$key]))
				trigger_error(sprintf(self::E_UNKNOWN_FIELD,$key,get_called_class()),E_USER_ERROR);
			if (!isset($this->fieldConf[$key]['relType']))
				trigger_error(self::E_HAS_COND,E_USER_ERROR);
			$this->hasCond[$key] = array($filter,$options);
		}
		return $this;
	}
249854
public function load($filter = NULL, array $options = NULL, $ttl = 0) {
		$this->reset();
		$this->_ttl=$ttl?:$this->rel_ttl;
		$res = $this->filteredFind($filter, $options, $ttl);
		if ($res) {
			$this->mapper->query = $res;
			$this->first();
		} else
			$this->mapper->reset();
		$this->emit('load');
		return $this->valid();
	}
467843
protected function _hasRefsIn($key, $filter, $options, $ttl = 0) {
		$type = $this->fieldConf[$key]['relType'];
		$fieldConf = $this->fieldConf[$key][$type];
		// one-to-many shortcut
		$rel = $this->getRelFromConf($fieldConf,$key);
		$hasSet = $rel->find($filter, $options, $ttl);
		if (!$hasSet)
			return false;
		$hasSetByRelId = array_unique($hasSet->getAll($fieldConf[1], true));
		return empty($hasSetByRelId) ? false : $hasSetByRelId;
	}
239655
public function addFilterMultiSelect($key, $name, array $options, $column = null)
	{
		$column = $column ?: $key;

		if (!is_string($column)) {
			throw new DataGridException('Filter MultiSelect can only filter in one column.');
		}

		$this->addFilterCheck($key);

		return $this->filters[$key] = new Filter\FilterMultiSelect($this, $key, $name, $options, $column);
	}
70932
public function handle(FilterOptionInterface $filter, array $options)
    {
        if (count($options) === 0) {
            return $filter;
        }

        $validOptions = $filter->getValidOptions();

        $this->validateFilterOptions($options, $validOptions);
        $this->setFilterOptions($filter, $options, $validOptions);

        return $filter;
    }
936748
public function updateOne(array $filter, $update, array $options = [])
    {
        list($bulkOptions, $options) = self::extractBulkWriteOptions($options);
        $model = new UpdateOne($filter, $update, $options);

        $bulkWriteResult = $this->bulkWrite([$model], $bulkOptions);

        return new UpdateResult($bulkWriteResult);
    }
311571
private function addFilters($filter, $recursive) {
		foreach ($filter as $item) {
			$this->addFilter($item, $recursive);
		}

		return $this;
	}
97314
public function addFilter(Filter $filter)
    {
        $key = $filter->getKey();
        $this->filters[$key] = $filter;
    }
1160288
public function load($array, $filter=false)
    {
        // apply the optional filter
        if (is_array($filter)) {
            $array = array_intersect_key($array, array_fill_keys($filter, NULL));
        }

        foreach ($array as $key=>$value) {
            if(is_object($value) || is_array($value))
                $this->$key = $value;
            else
                $this->__set($key, $value);
        }

        return $this;
    }
1327060
public function set($key, $value = null, $filter = null)
	{
		parent::set($key, $value);

		if (is_array($key))
		{
			if (is_bool($value))
			{
				$filter = $value;
			}

			foreach ($key as $_key => $_value)
			{
				$this->filterIndex[$_key] = $filter;
			}
		}
		else
		{
			$this->filterIndex[$key] = $filter;
		}

		return $this;
	}
945453
public function getByKey(string $key, AbstractFilter $filter = null)
    {
        return $this->children->getByKey($key, $filter);
    }
1187259
public function find($filter = NULL, array $options = NULL, $ttl = 0) {
		$sort=false;
		if ($this->dbsType!='sql') {
			// see if reordering is needed
			foreach($this->countFields?:[] as $counter) {
				if ($options && isset($options['order']) &&
					preg_match('/count_'.$counter.'\h+(asc|desc)/i',$options['order'],$match))
					$sort=true;
			}
			if ($sort) {
				// backup slice settings
				if (isset($options['limit'])) {
					$limit = $options['limit'];
					unset($options['limit']);
				}
				if (isset($options['offset'])) {
					$offset = $options['offset'];
					unset($options['offset']);
				}
			}
		}
		$this->_ttl=$ttl?:$this->rel_ttl;
		$result = $this->filteredFind($filter,$options,$ttl);
		if (empty($result))
			return false;
		foreach($result as &$record) {
			$record = $this->factory($record);
			unset($record);
		}
		// add counter for NoSQL engines
		foreach($this->countFields?:[] as $counter)
			foreach($result as &$mapper) {
				$cr=$mapper->get($counter);
				$mapper->virtual('count_'.$counter,$cr?count($cr):null);
				unset($mapper);
			}
		$cc = new CortexCollection();
		$cc->setModels($result);
		if($sort) {
			$cc->orderBy($options['order']);
			$cc->slice(isset($offset)?$offset:0,isset($limit)?$limit:NULL);
		}
		$this->clearFilter();
		return $cc;
	}
336671
public function addFilter($filter)
    {
        if (!$filter instanceof FilterInterface) {
            if (!is_callable($filter)) {
                throw new \InvalidArgumentException('Filter should be callable or ' . FilterInterface::class);
            }

            $filter = new CallbackFilter($filter);
        }

        $this->filters[] = $filter;

        return $this;
    }
844629
public function find(array $filter = [], array $options = [])
    {
        $cursor = $this->collection->find($filter, $options);
        $cursor->setTypeMap(['root' => 'array', 'document' => 'array', 'array' => 'array']);

        foreach ($cursor as $originalValues) {
            $values = $this->convertValues->convertToPHPValues($originalValues);

            $object = $this->hydrator->hydrate($values);

            $this->changesCollector->register($object, $originalValues);

            yield $object;
        }
    }
217026
public function add($name, $filter, array $options = [])
    {
        $this->_collection()->add($name, $filter, $options);

        return $this;
    }
54460
public function findFilter(Query $query, array $options)
    {
        foreach ($this->filters()->collection() as $name => $filter) {
            $filter->apply($query, $options);
        }

        return $query;
    }
986685
public function getByKey($key, \chilimatic\lib\datastructure\graph\filter\AbstractFilter $filter = null)
    {
        return $this->children->getByKey($key, $filter);
    }