ZF\Apigility\Admin\Model\AuthorizationEntity::get PHP Method

get() public method

public get ( $serviceName )
    public function get($serviceName)
    {
        if (!$this->has($serviceName)) {
            throw new Exception\InvalidArgumentException(sprintf('No service by the name of "%s" has been registered', $serviceName));
        }
        return $this->servicePrivileges[$serviceName];
    }

Usage Example

 public function testAddingAnRpcServiceWithoutHttpMethodsProvidesDefaults()
 {
     $entity = new AuthorizationEntity();
     $entity->addRpcService('Foo\\V1\\Rpc\\Message\\Controller', 'message');
     $this->assertTrue($entity->has('Foo\\V1\\Rpc\\Message\\Controller::message'));
     $privileges = $entity->get('Foo\\V1\\Rpc\\Message\\Controller::message');
     $this->assertEquals(['GET' => false, 'POST' => false, 'PATCH' => false, 'PUT' => false, 'DELETE' => false], $privileges);
 }