Doctrine\OrientDB\Query\Query::grant PHP Method

grant() public method

Converts the query into an GRANT with the given $permission.
public grant ( string $permission ) : Grant
$permission string
return Doctrine\OrientDB\Query\Command\Credential\Grant
    public function grant($permission)
    {
        $commandClass = $this->getCommandClass('grant');
        $this->command = new $commandClass($permission);
        return $this->command;
    }

Usage Example

 public function testGrantCredentials()
 {
     $query = new Query();
     $query->grant('READ')->to('reader')->on('Address');
     $this->assertHttpStatus(200, $this->doQuery($query));
 }