public static function getFromName($messageName)
    {
        if (false === $message = MessageQuery::create()->filterByName($messageName)->findOne()) {
            throw new \Exception("Failed to load message $messageName.");
        }

        return $message;
    }