public function setDocumentTypesConfig(array $documentTypes)
    {
        foreach ($documentTypes as $name => $class) {
            $documentType = new $class;
            if (!$documentType instanceof AbstractDocumentType) {
                throw new GeneratorServiceException(
                    'Configured class of document type must be descendant of'
                        . ' Infotech\DocumentGenerator\DocumentType\AbstractDocumentType class'
                );
            }
            $this->registerDocumentType($name, $documentType);
        }
    }
public function setDocumentTypesConfig(array $documentTypes)
    {
        foreach ($documentTypes as $name => $class) {
            $documentType = new $class;
            if (!$documentType instanceof AbstractDocumentType) {
                throw new GeneratorServiceException(
                    'Configured class of document type must be descendant of'
                        . ' Infotech\DocumentGenerator\DocumentType\AbstractDocumentType class'
                );
            }
            $this->registerDocumentType($name, $documentType);
        }
    }
public function setDocumentTypesConfig ( array $ documentTypes ) { foreach ( $ documentTypes as $ name => $ class ) { $ documentType = new $ class ; if ( ! $ documentType instanceof AbstractDocumentType ) { throw new GeneratorServiceException ( 'Configured class of document type must be descendant of' . ' Infotech\DocumentGenerator\DocumentType\AbstractDocumentType class' ) ; } $ this -> registerDocumentType ( $ name , $ documentType ) ; } }
Instantiate and registering document types

@param array $documentTypes Document types configuration map [name => fully qualified class name]
@throws GeneratorServiceException if map contains name of class that is not descendant of AbstractDocumentType
@throws GeneratorServiceException if map contains type name that already has been registered
Instantiate and registering document types