getObjectTypeIDByName('be.bastelstu.chat.messageType', $objectType); if (!$objectType) { throw new \LogicException('Missing object type'); } return $objectTypeID; } /** * Ensures that the given parameter exists in the parameter array and * throws otherwise. * * @param array $parameters * @param string $key * @return mixed The value. */ public function assertParameter($parameters, $key) { if (array_key_exists($key, $parameters)) { return $parameters[$key]; } throw new UserInputException('message'); } }