original_string: public function getResourceUserPermission(ResourceInterface $resource, UserInterface $user)
      {
          $query = $this->getRepository()->createQueryBuilder('r')
              ->select('r')
              ->where('r.resource_class = :resourceClass AND r.resource_id=:resourceId AND r.user=:user')
              ->setParameter('resourceClass', $resource->getClass())
              ->setParameter('resourceId', $resource->getId())
              ->setParameter('user', $user)
              ->getQuery();
  
          return $query->getOneOrNullResult();
      }
code: public function getResourceUserPermission(ResourceInterface $resource, UserInterface $user)
      {
          $query = $this->getRepository()->createQueryBuilder('r')
              ->select('r')
              ->where('r.resource_class = :resourceClass AND r.resource_id=:resourceId AND r.user=:user')
              ->setParameter('resourceClass', $resource->getClass())
              ->setParameter('resourceId', $resource->getId())
              ->setParameter('user', $user)
              ->getQuery();
  
          return $query->getOneOrNullResult();
      }
code_tokens: public function getResourceUserPermission ( ResourceInterface $ resource , UserInterface $ user ) { $ query = $ this -> getRepository ( ) -> createQueryBuilder ( 'r' ) -> select ( 'r' ) -> where ( 'r.resource_class = :resourceClass AND r.resource_id=:resourceId AND r.user=:user' ) -> setParameter ( 'resourceClass' , $ resource -> getClass ( ) ) -> setParameter ( 'resourceId' , $ resource -> getId ( ) ) -> setParameter ( 'user' , $ user ) -> getQuery ( ) ; return $ query -> getOneOrNullResult ( ) ; }
docstring: Get resource-type permissions from the database
  
  @param ResourceInterface $resource
  @param UserInterface     $user
  
  @return array
  @throws \Doctrine\ORM\NonUniqueResultException
docstring_tokens: Get resource - type permissions from the database