src/Policy/OrmResolver.php
public function getPolicy($resource)
    {
        if ($resource instanceof EntityInterface) {
            return $this->getEntityPolicy($resource);
        }
        if ($resource instanceof RepositoryInterface) {
            return $this->getRepositoryPolicy($resource);
        }
        if ($resource instanceof QueryInterface) {
            return $this->getRepositoryPolicy($resource->repository());
        }
        $name = is_object($resource) ? get_class($resource) : gettype($resource);
        throw new MissingPolicyException([$name]);
    }
public function getPolicy($resource)
    {
        if ($resource instanceof EntityInterface) {
            return $this->getEntityPolicy($resource);
        }
        if ($resource instanceof RepositoryInterface) {
            return $this->getRepositoryPolicy($resource);
        }
        if ($resource instanceof QueryInterface) {
            return $this->getRepositoryPolicy($resource->repository());
        }
        $name = is_object($resource) ? get_class($resource) : gettype($resource);
        throw new MissingPolicyException([$name]);
    }
public function getPolicy ( $ resource ) { if ( $ resource instanceof EntityInterface ) { return $ this -> getEntityPolicy ( $ resource ) ; } if ( $ resource instanceof RepositoryInterface ) { return $ this -> getRepositoryPolicy ( $ resource ) ; } if ( $ resource instanceof QueryInterface ) { return $ this -> getRepositoryPolicy ( $ resource -> repository ( ) ) ; } $ name = is_object ( $ resource ) ? get_class ( $ resource ) : gettype ( $ resource ) ; throw new MissingPolicyException ( [ $ name ] ) ; }
Get a policy for an ORM Table, Entity or Query.

@param \Cake\Datasource\RepositoryInterface|\Cake\Datasource\EntityInterface|\Cake\Datasource\QueryInterface $resource The resource.
@return object
@throws \Authorization\Policy\Exception\MissingPolicyException When a policy for the
resource has not been defined or cannot be resolved.
Get a policy for an ORM Table Entity or Query .