protected function getPrintDocument($documentId) { $document = Document\Printpage::getById($documentId); if (empty($document)) { throw new \Exception("PrintDocument with " . $documentId . " not found."); } return $document; }