src/Charcoal/Source/AbstractSource.php
public function addFilter($param, $value = null, array $options = null)
    {
        if (is_string($param) && $value !== null) {
            $expr = $this->createFilter();
            $expr->setProperty($param);
            $expr->setValue($value);
        } else {
            $expr = $param;
        }

        $expr = $this->processFilter($expr);

        /** @deprecated 0.3 */
        if (is_array($param) && isset($param['options'])) {
            $expr->setData($param['options']);
        }

        if (is_array($options)) {
            $expr->setData($options);
        }

        $this->filters[] = $this->parseFilterWithModel($expr);
        return $this;
    }
public function addFilter($param, $value = null, array $options = null)
    {
        if (is_string($param) && $value !== null) {
            $expr = $this->createFilter();
            $expr->setProperty($param);
            $expr->setValue($value);
        } else {
            $expr = $param;
        }

        $expr = $this->processFilter($expr);

        /** @deprecated 0.3 */
        if (is_array($param) && isset($param['options'])) {
            $expr->setData($param['options']);
        }

        if (is_array($options)) {
            $expr->setData($options);
        }

        $this->filters[] = $this->parseFilterWithModel($expr);
        return $this;
    }
public function addFilter ( $ param , $ value = null , array $ options = null ) { if ( is_string ( $ param ) && $ value !== null ) { $ expr = $ this -> createFilter ( ) ; $ expr -> setProperty ( $ param ) ; $ expr -> setValue ( $ value ) ; } else { $ expr = $ param ; } $ expr = $ this -> processFilter ( $ expr ) ; /** @deprecated 0.3 */ if ( is_array ( $ param ) && isset ( $ param [ 'options' ] ) ) { $ expr -> setData ( $ param [ 'options' ] ) ; } if ( is_array ( $ options ) ) { $ expr -> setData ( $ options ) ; } $ this -> filters [ ] = $ this -> parseFilterWithModel ( $ expr ) ; return $ this ; }
Append a query filter on the source.

There are 3 different ways of adding a filter:
- as a `Filter` object, in which case it will be added directly.
- `addFilter($obj);`
- as an array of options, which will be used to build the `Filter` object
- `addFilter(['property' => 'foo', 'value' => 42, 'operator' => '<=']);`
- as 3 parameters: `property`, `value` and `options`
- `addFilter('foo', 42, ['operator' => '<=']);`

@deprecated 0.3 To be replaced with FilterCollectionTrait::addFilter()

@uses   self::parseFilterWithModel()
@uses   FilterCollectionTrait::processFilter()
@param  mixed $param   The property to filter by,
a {@see FilterInterface} object,
or a filter array structure.
@param  mixed $value   Optional value for the property to compare against.
Only used if the first argument is a string.
@param  array $options Optional extra settings to apply on the filter.
@throws InvalidArgumentException If the $param argument is invalid.
@return self
Append a query filter on the source .