From 4d6c4aa9a8e29b19bafad59dcf9c5a8b8e848bdd Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 12 Mar 2017 22:40:21 +0100 Subject: [PATCH] PhpUnit fixes --- Admin/Installer.php | 12 ++----- Models/Item.php | 80 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 81 insertions(+), 11 deletions(-) diff --git a/Admin/Installer.php b/Admin/Installer.php index f2bd77c..31a2e48 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -71,6 +71,7 @@ class Installer extends InstallerAbstract `itemreference_segmentation_l11n_id` int(11) NOT NULL AUTO_INCREMENT, `itemreference_segmentation_no` varchar(30) DEFAULT NULL, `itemreference_segmentation_name` varchar(30) DEFAULT NULL, + `itemreference_segmentation_language` varchar(30) DEFAULT NULL, PRIMARY KEY (`itemreference_segmentation_l11n_id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;' )->execute(); @@ -80,16 +81,7 @@ class Installer extends InstallerAbstract `itemreference_media_id` int(11) NOT NULL AUTO_INCREMENT, `itemreference_media_item` int(11) DEFAULT NULL, `itemreference_media_media` int(11) DEFAULT NULL, - PRIMARY KEY (`itemreference_partslist_id`) - )ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;' - )->execute(); - - $dbPool->get('core')->con->prepare( - 'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'itemreference_docs` ( - `itemreference_docs_id` int(11) NOT NULL AUTO_INCREMENT, - `itemreference_docs_item` int(11) DEFAULT NULL, - `itemreference_docs_media` int(11) DEFAULT NULL, - PRIMARY KEY (`itemreference_partslist_id`) + PRIMARY KEY (`itemreference_media_id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;' )->execute(); diff --git a/Models/Item.php b/Models/Item.php index 1dd60a0..253132e 100644 --- a/Models/Item.php +++ b/Models/Item.php @@ -16,6 +16,8 @@ declare(strict_types=1); namespace Modules\ItemManagement\Models; +use Modules\Media\Models\Media; + /** * Account class. * @@ -43,38 +45,114 @@ class Item private $successor = 0; - public function __construct(int $id = 0) + private $media = []; + + private $l11n = null; + + private $attributes = []; + + private $partslist = null; + + private $purchase = []; + + private $disposal = null; + + private $createdAt = null; + + private $info = ''; + + public function __construct() { $this->createdAt = new \DateTime('now'); } + public function getId() : int + { + return $this->id; + } + + public function getCreatedAt() : \DateTime + { + return $this->createdAt; + } + public function getNumber() : int { return $this->number; } + public function setNumber(int $number) /* : void */ + { + $this->number = $number; + } + public function getArticleGroup() : int { return $this->articleGroup; } + public function setArticleGroup(int $segment) /* : void */ + { + $this->articleGroup = $segment; + } + public function getSalesGroup() : int { return $this->salesGroup; } + public function setSalesGroup(int $segment) /* : void */ + { + $this->salesGroup = $segment; + } + public function getProductGroup() : int { return $this->productGroup; } + public function setProductGroup(int $segment) /* : void */ + { + $this->productGroup = $segment; + } + public function getSegment() : int { return $this->segment; } + public function setSegment(int $segment) /* : void */ + { + $this->segment = $segment; + } + public function getSuccessor() : int { return $this->successor; } + + public function setSuccessor(int $successor) /* : void */ + { + $this->successor = $successor; + } + + public function getMedia() : array + { + return $this->media; + } + + public function addMedia(Media $media) /* : void */ + { + $this->media[] = $media; + } + + public function getInfo() : string + { + return $this->info; + } + + public function setInfo(string $info) /* : void */ + { + $this->info = $info; + } }