Cake\ORM\Association\BelongsToMany::targetConditions PHP Method

targetConditions() protected method

Any string expressions, or expression objects will also be returned in this list.
protected targetConditions ( ) : mixed
return mixed Generally an array. If the conditions are not an array, the association conditions will be returned unmodified.
    protected function targetConditions()
    {
        if ($this->_targetConditions !== null) {
            return $this->_targetConditions;
        }
        $conditions = $this->conditions();
        if (!is_array($conditions)) {
            return $conditions;
        }
        $matching = [];
        $alias = $this->alias() . '.';
        foreach ($conditions as $field => $value) {
            if (is_string($field) && strpos($field, $alias) === 0) {
                $matching[$field] = $value;
            } elseif (is_int($field) || $value instanceof ExpressionInterface) {
                $matching[$field] = $value;
            }
        }
        return $this->_targetConditions = $matching;
    }