src/Model/Behavior/FootprintBehavior.php
protected function _injectConditions(Query $query, ArrayObject $options, array $fields)
    {
        foreach (array_keys($fields) as $field) {
            $path = $this->getConfig('propertiesMap.' . $field);

            $check = false;
            $query->traverseExpressions(function ($expression) use (&$check, $field, $query) {
                if ($expression instanceof IdentifierExpression) {
                    !$check && $check = $expression->getIdentifier() === $field;

                    return;
                }
                $alias = $this->_table->aliasField($field);
                !$check && $check = preg_match(
                    '/^' . $alias . '/',
                    $expression->sql($query->getValueBinder())
                );
            });

            if (!$check && $value = Hash::get((array)$options, $path)) {
                $query->where([$this->_table->aliasField($field) => $value]);
            }
        }
    }
protected function _injectConditions(Query $query, ArrayObject $options, array $fields)
    {
        foreach (array_keys($fields) as $field) {
            $path = $this->getConfig('propertiesMap.' . $field);

            $check = false;
            $query->traverseExpressions(function ($expression) use (&$check, $field, $query) {
                if ($expression instanceof IdentifierExpression) {
                    !$check && $check = $expression->getIdentifier() === $field;

                    return;
                }
                $alias = $this->_table->aliasField($field);
                !$check && $check = preg_match(
                    '/^' . $alias . '/',
                    $expression->sql($query->getValueBinder())
                );
            });

            if (!$check && $value = Hash::get((array)$options, $path)) {
                $query->where([$this->_table->aliasField($field) => $value]);
            }
        }
    }
protected function _injectConditions ( Query $ query , ArrayObject $ options , array $ fields ) { foreach ( array_keys ( $ fields ) as $ field ) { $ path = $ this -> getConfig ( 'propertiesMap.' . $ field ) ; $ check = false ; $ query -> traverseExpressions ( function ( $ expression ) use ( & $ check , $ field , $ query ) { if ( $ expression instanceof IdentifierExpression ) { ! $ check && $ check = $ expression -> getIdentifier ( ) === $ field ; return ; } $ alias = $ this -> _table -> aliasField ( $ field ) ; ! $ check && $ check = preg_match ( '/^' . $ alias . '/' , $ expression -> sql ( $ query -> getValueBinder ( ) ) ) ; } ) ; if ( ! $ check && $ value = Hash :: get ( ( array ) $ options , $ path ) ) { $ query -> where ( [ $ this -> _table -> aliasField ( $ field ) => $ value ] ) ; } } }
Injects configured fields into finder conditions.

@param \Cake\ORM\Query $query Query.
@param \ArrayObject $options Options.
@param array $fields Field configuration.
@return void
Injects configured fields into finder conditions .