public function getExportByRef($exportRef, $dispatchException = false)
    {
        $export = (new ExportQuery)->findOneByRef($exportRef);

        if ($export === null && $dispatchException) {
            throw new \ErrorException(
                Translator::getInstance()->trans(
                    'There is no ref "%ref" in the exports',
                    [
                        '%ref' => $exportRef
                    ]
                )
            );
        }

        return $export;
    }