diff --git a/Admin/Install/Media.install.json b/Admin/Install/Media.install.json index 5cd95c7..7de8713 100755 --- a/Admin/Install/Media.install.json +++ b/Admin/Install/Media.install.json @@ -26,5 +26,47 @@ "lang": "de" } ] + }, + { + "type": "type", + "name": "item_demo_download", + "l11n": [ + { + "title": "Public Download", + "lang": "en" + }, + { + "title": "Oeffentlich Download", + "lang": "de" + } + ] + }, + { + "type": "type", + "name": "item_private_download", + "l11n": [ + { + "title": "Private Download", + "lang": "en" + }, + { + "title": "Privat Download", + "lang": "de" + } + ] + }, + { + "type": "type", + "name": "item_purchase_download", + "l11n": [ + { + "title": "Purchased Download", + "lang": "en" + }, + { + "title": "Gekaufter Download", + "lang": "de" + } + ] } ] \ No newline at end of file diff --git a/Admin/Install/attributes.json b/Admin/Install/attributes.json index f2f7687..1adfdc3 100755 --- a/Admin/Install/attributes.json +++ b/Admin/Install/attributes.json @@ -633,19 +633,6 @@ } ] }, - { - "name": "download_link", - "l11n": { - "en": "Download link", - "de": "Download Link" - }, - "value_type": 2, - "is_custom_allowed": true, - "validation_pattern": "", - "is_required": false, - "default_value": "", - "values": [] - }, { "name": "demo_link", "l11n": { @@ -663,7 +650,7 @@ "name": "one_click_pay_cc", "l11n": { "en": "One Click CC payment link", - "de": "One Click CC Beyahllink" + "de": "One Click CC Bezahl-Link" }, "value_type": 2, "is_custom_allowed": true, @@ -676,7 +663,7 @@ "name": "one_click_pay_cc_id", "l11n": { "en": "One Click CC payment ID", - "de": "One Click CC Beyahl ID" + "de": "One Click CC Bezahl-ID" }, "value_type": 2, "is_custom_allowed": true, @@ -689,7 +676,7 @@ "name": "one_click_pay_paypal", "l11n": { "en": "One Click Paypal payment link", - "de": "One Click Paypal Beyahllink" + "de": "One Click Paypal Bezahl-Link" }, "value_type": 2, "is_custom_allowed": true, diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php index cbd57e6..0eb8e60 100755 --- a/Admin/Routes/Web/Api.php +++ b/Admin/Routes/Web/Api.php @@ -28,5 +28,5 @@ return [ 'state' => PermissionCategory::SALES_ITEM, ], ], - ], + ] ]; diff --git a/Controller/ApiController.php b/Controller/ApiController.php index c217aeb..4a9c686 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -57,13 +57,13 @@ use phpOMS\System\MimeType; use phpOMS\Uri\HttpUri; /** - Item* ItemManagement class. + * ItemManagement class. * * @package Modules\ItemManagement * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 - Item*/ + */ final class ApiController extends Controller { /** diff --git a/Models/Item.php b/Models/Item.php index 3bff141..79edf3f 100755 --- a/Models/Item.php +++ b/Models/Item.php @@ -56,15 +56,7 @@ class Item implements \JsonSerializable public Money $purchasePrice; /** - * Files. - * - * @var Media[] - * @since 1.0.0 - */ - private array $files = []; - - /** - * Files. + * Notes. * * @var EditorDoc[] * @since 1.0.0 @@ -79,14 +71,6 @@ class Item implements \JsonSerializable */ private array $l11n = []; - /** - * Attributes. - * - * @var \Modules\Attribute\Models\Attribute[] - * @since 1.0.0 - */ - private array $attributes = []; - public ?int $partslist = null; public ?int $disposal = null; @@ -211,20 +195,6 @@ class Item implements \JsonSerializable $this->status = $status; } - /** - * Add media to item - * - * @param Media $media Media - * - * @return void - * - * @since 1.0.0 - */ - public function addFile(Media $media) : void - { - $this->files[] = $media; - } - /** * Add note to item * @@ -251,79 +221,6 @@ class Item implements \JsonSerializable return $this->notes; } - /** - * Get files - * - * @return Media[] - * - * @since 1.0.0 - */ - public function getFiles() : array - { - return $this->files; - } - - /** - * Get media file by type - * - * @param int $type Media type - * - * @return Media - * - * @since 1.0.0 - */ - public function getFileByType(int $type) : Media - { - foreach ($this->files as $file) { - if ($file->hasMediaTypeId($type)) { - return $file; - } - } - - return new NullMedia(); - } - - /** - * Get all media files by type name - * - * @param string $type Media type - * - * @return Media - * - * @since 1.0.0 - */ - public function getFileByTypeName(string $type) : Media - { - foreach ($this->files as $file) { - if ($file->hasMediaTypeName($type)) { - return $file; - } - } - - return new NullMedia(); - } - - /** - * Get all media files by type name - * - * @param string $type Media type - * - * @return Media[] - * - * @since 1.0.0 - */ - public function getFilesByTypeName(string $type) : array - { - $files = []; - foreach ($this->files as $file) { - if ($file->hasMediaTypeName($type)) { - $files[] = $file; - } - } - - return $files; - } - /** * {@inheritdoc} */ @@ -346,5 +243,6 @@ class Item implements \JsonSerializable return $this->toArray(); } + use \Modules\Media\Models\MediaListTrait; use \Modules\Attribute\Models\AttributeHolderTrait; } diff --git a/Models/ItemL11nMapper.php b/Models/ItemL11nMapper.php index 4e97aff..83f7da4 100755 --- a/Models/ItemL11nMapper.php +++ b/Models/ItemL11nMapper.php @@ -24,7 +24,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; * @link https://jingga.app * @since 1.0.0 * - * @template T of BaseStringL11n + * @template T of ItemL11n * @extends DataMapperFactory */ final class ItemL11nMapper extends DataMapperFactory