Пример #1
0
	public function close_conversation(Conversation $conversation) {
		/*
		(Conversation) -> Bool
		*/
		if ($this->user_id) {
			if ($conversation->action_allowed($this, __METHOD__)) {
				$conversation->close_self();
			}
			else {
				throw new OutOfBoundsException('OutOfBoundsException occured on method call close_conversation becauase the current user does not have permission to perform this action');
			}
		}
		else {
			throw new UnexpectedValueException('UnexpectedValueException occured on method call ' . __METHOD__ . ' because the user id is invalid');
		}
	}