Pop\Auth\Resource::factory PHP Метод

factory() публичный статический Метод

Static method to instantiate the resource object and return itself to facilitate chaining methods together.
public static factory ( string $name ) : Resource
$name string
Результат Resource
    public static function factory($name)
    {
        return new self($name);
    }

Usage Example

Пример #1
0
 public function testRemoveDeny()
 {
     $editor = Role::factory('editor');
     $editor->addPermission('edit');
     $page = Resource::factory('page');
     $a = Acl::factory($editor, $page);
     $a->allow('editor', 'page', 'edit');
     $a->deny('editor', 'page', 'edit');
     $this->assertFalse($a->isAllowed($editor, 'page', 'edit'));
     $a->removeDeny('editor', 'page', 'edit');
     $a->removeDeny('editor');
     $this->assertTrue($a->isAllowed($editor, 'page', 'edit'));
 }
All Usage Examples Of Pop\Auth\Resource::factory