public function saveDocumentType($slug, $postValues)
    {
        $documentTypeObject = DocumentTypeFactory::createDocumentTypeFromPostValues($postValues);

        $documentTypes = $this->repository->documentTypes;
        foreach ($documentTypes as $key => $documentType) {
            if ($documentType->slug == $slug) {
                $documentTypes[$key] = $documentTypeObject;
            }
        }
        $this->repository->documentTypes = $documentTypes;
        $this->save();
    }
public function saveDocumentType($slug, $postValues)
    {
        $documentTypeObject = DocumentTypeFactory::createDocumentTypeFromPostValues($postValues);

        $documentTypes = $this->repository->documentTypes;
        foreach ($documentTypes as $key => $documentType) {
            if ($documentType->slug == $slug) {
                $documentTypes[$key] = $documentTypeObject;
            }
        }
        $this->repository->documentTypes = $documentTypes;
        $this->save();
    }
public function saveDocumentType ( $ slug , $ postValues ) { $ documentTypeObject = DocumentTypeFactory :: createDocumentTypeFromPostValues ( $ postValues ) ; $ documentTypes = $ this -> repository -> documentTypes ; foreach ( $ documentTypes as $ key => $ documentType ) { if ( $ documentType -> slug == $ slug ) { $ documentTypes [ $ key ] = $ documentTypeObject ; } } $ this -> repository -> documentTypes = $ documentTypes ; $ this -> save ( ) ; }
Save changes to a document type

@param $slug
@param $postValues

@throws \Exception
Save changes to a document type