public function add(ObjectInterface ...$objects)
    {
        foreach ($objects as $object)
        {
            if ($object instanceof RoleInterface)
            {
                $this->addRole((string)$object);
            }
            else if ($object instanceof ResourceInterface)
            {
                $this->addResource((string)$object);
            }
            else if ($object instanceof PermissionInterface)
            {
                $this->addPermission((string)$object);
            }
            else {
                throw new \Exception(
                    sprintf(
                        "%s must implement one of RoleInterface, '.
                        'ResourceInterface and PermissionInterface",
                        $object
                    )
                );
            }   
        }
    }
public function add(ObjectInterface ...$objects)
    {
        foreach ($objects as $object)
        {
            if ($object instanceof RoleInterface)
            {
                $this->addRole((string)$object);
            }
            else if ($object instanceof ResourceInterface)
            {
                $this->addResource((string)$object);
            }
            else if ($object instanceof PermissionInterface)
            {
                $this->addPermission((string)$object);
            }
            else {
                throw new \Exception(
                    sprintf(
                        "%s must implement one of RoleInterface, '.
                        'ResourceInterface and PermissionInterface",
                        $object
                    )
                );
            }   
        }
    }
public function add ( ObjectInterface ... $ objects ) { foreach ( $ objects as $ object ) { if ( $ object instanceof RoleInterface ) { $ this -> addRole ( ( string ) $ object ) ; } else if ( $ object instanceof ResourceInterface ) { $ this -> addResource ( ( string ) $ object ) ; } else if ( $ object instanceof PermissionInterface ) { $ this -> addPermission ( ( string ) $ object ) ; } else { throw new \ Exception ( sprintf ( "%s must implement one of RoleInterface, '.
                        'ResourceInterface and PermissionInterface" , $ object ) ) ; } } }
Adds objects lazily.

Automatically determine the type of an object and call the appropriate
add method on it.

@param ObjectInterface[] $objects
@throws \Exception
@return void
Adds objects lazily .