diff --git a/Controller/ApiController.php b/Controller/ApiController.php index dbde83d..a7b07cd 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -97,7 +97,7 @@ final class ApiController extends Controller $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Document', 'Document type successfully created', $type); } - /** + /** * Method to create task from request. * * @param RequestAbstract $request Request @@ -279,10 +279,10 @@ final class ApiController extends Controller MediaMapper::create()->execute($media); EditorDocMapper::writer()->createRelationTable('media', [$media->getId()], $doc->getId()); - $ref = new Reference(); - $ref->name = $media->name; - $ref->source = new NullMedia($media->getId()); - $ref->createdBy = new NullAccount($request->header->account); + $ref = new Reference(); + $ref->name = $media->name; + $ref->source = new NullMedia($media->getId()); + $ref->createdBy = new NullAccount($request->header->account); $ref->setVirtualPath($accountPath = '/Accounts/' . $account->getId() . ' ' . $account->login . '/Editor/' . $doc->createdAt->format('Y') . '/' . $doc->createdAt->format('m') . '/' . $doc->getId()); ReferenceMapper::create()->execute($ref); diff --git a/Models/EditorDocHistory.php b/Models/EditorDocHistory.php index bed41bf..ea74760 100644 --- a/Models/EditorDocHistory.php +++ b/Models/EditorDocHistory.php @@ -16,8 +16,6 @@ namespace Modules\Editor\Models; use Modules\Admin\Models\Account; use Modules\Admin\Models\NullAccount; -use Modules\Media\Models\Media; -use Modules\Tag\Models\Tag; /** * News article class. diff --git a/Models/EditorDocHistoryMapper.php b/Models/EditorDocHistoryMapper.php index 4ef27c7..f30c42d 100644 --- a/Models/EditorDocHistoryMapper.php +++ b/Models/EditorDocHistoryMapper.php @@ -34,13 +34,13 @@ final class EditorDocHistoryMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'editor_doc_versioned_id' => ['name' => 'editor_doc_versioned_id', 'type' => 'int', 'internal' => 'id'], + 'editor_doc_versioned_id' => ['name' => 'editor_doc_versioned_id', 'type' => 'int', 'internal' => 'id'], 'editor_doc_versioned_version' => ['name' => 'editor_doc_versioned_version', 'type' => 'string', 'internal' => 'version'], - 'editor_doc_versioned_title' => ['name' => 'editor_doc_versioned_title', 'type' => 'string', 'internal' => 'title'], - 'editor_doc_versioned_plain' => ['name' => 'editor_doc_versioned_plain', 'type' => 'string', 'internal' => 'plain'], - 'editor_doc_versioned_content' => ['name' => 'editor_doc_versioned_content', 'type' => 'string', 'internal' => 'content'], - 'editor_doc_versioned_at' => ['name' => 'editor_doc_versioned_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], - 'editor_doc_versioned_by' => ['name' => 'editor_doc_versioned_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true], + 'editor_doc_versioned_title' => ['name' => 'editor_doc_versioned_title', 'type' => 'string', 'internal' => 'title'], + 'editor_doc_versioned_plain' => ['name' => 'editor_doc_versioned_plain', 'type' => 'string', 'internal' => 'plain'], + 'editor_doc_versioned_content' => ['name' => 'editor_doc_versioned_content', 'type' => 'string', 'internal' => 'content'], + 'editor_doc_versioned_at' => ['name' => 'editor_doc_versioned_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], + 'editor_doc_versioned_by' => ['name' => 'editor_doc_versioned_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true], ]; /** diff --git a/Models/EditorDocMapper.php b/Models/EditorDocMapper.php index ea8e282..d64b379 100755 --- a/Models/EditorDocMapper.php +++ b/Models/EditorDocMapper.php @@ -37,17 +37,17 @@ final class EditorDocMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'editor_doc_id' => ['name' => 'editor_doc_id', 'type' => 'int', 'internal' => 'id'], + 'editor_doc_id' => ['name' => 'editor_doc_id', 'type' => 'int', 'internal' => 'id'], 'editor_doc_version' => ['name' => 'editor_doc_version', 'type' => 'string', 'internal' => 'version'], - 'editor_doc_title' => ['name' => 'editor_doc_title', 'type' => 'string', 'internal' => 'title'], - 'editor_doc_plain' => ['name' => 'editor_doc_plain', 'type' => 'string', 'internal' => 'plain'], - 'editor_doc_content' => ['name' => 'editor_doc_content', 'type' => 'string', 'internal' => 'content'], - 'editor_doc_type' => ['name' => 'editor_doc_type', 'type' => 'int', 'internal' => 'type'], - 'editor_doc_virtual' => ['name' => 'editor_doc_virtual', 'type' => 'string', 'internal' => 'virtualPath'], + 'editor_doc_title' => ['name' => 'editor_doc_title', 'type' => 'string', 'internal' => 'title'], + 'editor_doc_plain' => ['name' => 'editor_doc_plain', 'type' => 'string', 'internal' => 'plain'], + 'editor_doc_content' => ['name' => 'editor_doc_content', 'type' => 'string', 'internal' => 'content'], + 'editor_doc_type' => ['name' => 'editor_doc_type', 'type' => 'int', 'internal' => 'type'], + 'editor_doc_virtual' => ['name' => 'editor_doc_virtual', 'type' => 'string', 'internal' => 'virtualPath'], 'editor_doc_versioned' => ['name' => 'editor_doc_versioned', 'type' => 'bool', 'internal' => 'isVersioned'], - 'editor_doc_created_at' => ['name' => 'editor_doc_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'], - 'editor_doc_created_by' => ['name' => 'editor_doc_created_by', 'type' => 'int', 'internal' => 'createdBy'], - 'editor_doc_visible' => ['name' => 'editor_doc_visible', 'type' => 'bool', 'internal' => 'isVisible'], + 'editor_doc_created_at' => ['name' => 'editor_doc_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'], + 'editor_doc_created_by' => ['name' => 'editor_doc_created_by', 'type' => 'int', 'internal' => 'createdBy'], + 'editor_doc_visible' => ['name' => 'editor_doc_visible', 'type' => 'bool', 'internal' => 'isVisible'], ]; /**