addType('id', 'integer'); $this->addType('boardId', 'integer'); $this->addType('permissionEdit', 'boolean'); $this->addType('permissionShare', 'boolean'); $this->addType('permissionManage', 'boolean'); $this->addType('type', 'integer'); $this->addType('owner', 'boolean'); $this->addRelation('owner'); $this->addResolvable('participant'); } public function getPermission($permission) { switch ($permission) { case self::PERMISSION_READ: return true; case self::PERMISSION_EDIT: return $this->getPermissionEdit(); case self::PERMISSION_SHARE: return $this->getPermissionShare(); case self::PERMISSION_MANAGE: return $this->getPermissionManage(); } return false; } }