Gc\User\Acl::__construct PHP Method

__construct() public method

Initiliaze Acl
public __construct ( Model $userModel )
$userModel Model User model
    public function __construct(UserModel $userModel)
    {
        $this->roleTable = new RoleModel();
        $this->user = $userModel;
        $this->roleResource();
        $select = new Select();
        $select->from('user_acl_role')->join('user', 'user.user_acl_role_id = user_acl_role.id');
        $select->where->equalTo('user.id', $this->user->getId());
        $userRole = $this->roleTable->fetchRow($select);
        $this->userRole = empty($userRole['role_id']) ? 0 : $userRole['role_id'];
        $this->userRoleName = empty($userRole['name']) ? null : $userRole['name'];
    }