protected function _scope($query)
    {
        $scope = $this->getConfig('scope');

        if (is_array($scope)) {
            return $query->where($scope);
        }
        if (is_callable($scope)) {
            return $scope($query);
        }

        return $query;
    }
protected function _scope($query)
    {
        $scope = $this->getConfig('scope');

        if (is_array($scope)) {
            return $query->where($scope);
        }
        if (is_callable($scope)) {
            return $scope($query);
        }

        return $query;
    }
protected function _scope ( $ query ) { $ scope = $ this -> getConfig ( 'scope' ) ; if ( is_array ( $ scope ) ) { return $ query -> where ( $ scope ) ; } if ( is_callable ( $ scope ) ) { return $ scope ( $ query ) ; } return $ query ; }
Alters the passed query so that it only returns scoped records as defined
in the tree configuration.

@param \Cake\ORM\Query $query the Query to modify
@return \Cake\ORM\Query
Alters the passed query so that it only returns scoped records as defined in the tree configuration .