pocketmine\permission\PermissibleBase::removeAttachment PHP Метод

removeAttachment() публичный Метод

public removeAttachment ( PermissionAttachment $attachment )
$attachment PermissionAttachment
    public function removeAttachment(PermissionAttachment $attachment)
    {
        if ($attachment === null) {
            throw new \InvalidStateException("Attachment cannot be null");
        }
        if (isset($this->attachments[spl_object_hash($attachment)])) {
            unset($this->attachments[spl_object_hash($attachment)]);
            if (($ex = $attachment->getRemovalCallback()) !== null) {
                $ex->attachmentRemoved($attachment);
            }
            $this->recalculatePermissions();
        }
    }

Usage Example

Пример #1
0
 /**
  * @param PermissionAttachment $attachment
  */
 public function removeAttachment(PermissionAttachment $attachment)
 {
     $this->perm->removeAttachment($attachment);
 }
All Usage Examples Of pocketmine\permission\PermissibleBase::removeAttachment