remove some getter/setter

This commit is contained in:
Dennis Eichhorn 2020-11-24 17:31:20 +01:00
parent f43ad63f5b
commit 753f1bab20
11 changed files with 72 additions and 202 deletions

View File

@ -64,13 +64,13 @@ final class ApiController extends Controller
{ {
if (!empty($val = $this->validateItemCreate($request))) { if (!empty($val = $this->validateItemCreate($request))) {
$response->set('item_create', new FormValidation($val)); $response->set('item_create', new FormValidation($val));
$response->getHeader()->setStatusCode(RequestStatusCode::R_400); $response->header->status = RequestStatusCode::R_400;
return; return;
} }
$item = $this->createItemFromRequest($request); $item = $this->createItemFromRequest($request);
$this->createModel($request->getHeader()->getAccount(), $item, ItemMapper::class, 'item', $request->getOrigin()); $this->createModel($request->header->account, $item, ItemMapper::class, 'item', $request->getOrigin());
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Item', 'Item successfully created', $item); $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Item', 'Item successfully created', $item);
} }
@ -86,7 +86,7 @@ final class ApiController extends Controller
private function createItemFromRequest(RequestAbstract $request) : Item private function createItemFromRequest(RequestAbstract $request) : Item
{ {
$item = new Item(); $item = new Item();
$item->setNumber($request->getData('number') ?? ''); $item->number = $request->getData('number') ?? '';
return $item; return $item;
} }
@ -127,13 +127,13 @@ final class ApiController extends Controller
{ {
if (!empty($val = $this->validateItemAttributeCreate($request))) { if (!empty($val = $this->validateItemAttributeCreate($request))) {
$response->set('attribute_create', new FormValidation($val)); $response->set('attribute_create', new FormValidation($val));
$response->getHeader()->setStatusCode(RequestStatusCode::R_400); $response->header->status = RequestStatusCode::R_400;
return; return;
} }
$attribute = $this->createItemAttributeFromRequest($request); $attribute = $this->createItemAttributeFromRequest($request);
$this->createModel($request->getHeader()->getAccount(), $attribute, ItemAttributeMapper::class, 'attribute', $request->getOrigin()); $this->createModel($request->header->account, $attribute, ItemAttributeMapper::class, 'attribute', $request->getOrigin());
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Attribute', 'Attribute successfully created', $attribute); $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Attribute', 'Attribute successfully created', $attribute);
} }
@ -195,13 +195,13 @@ final class ApiController extends Controller
{ {
if (!empty($val = $this->validateItemAttributeTypeL11nCreate($request))) { if (!empty($val = $this->validateItemAttributeTypeL11nCreate($request))) {
$response->set('attr_type_l11n_create', new FormValidation($val)); $response->set('attr_type_l11n_create', new FormValidation($val));
$response->getHeader()->setStatusCode(RequestStatusCode::R_400); $response->header->status = RequestStatusCode::R_400;
return; return;
} }
$attrL11n = $this->createItemAttributeTypeL11nFromRequest($request); $attrL11n = $this->createItemAttributeTypeL11nFromRequest($request);
$this->createModel($request->getHeader()->getAccount(), $attrL11n, ItemAttributeTypeL11nMapper::class, 'attr_type_l11n', $request->getOrigin()); $this->createModel($request->header->account, $attrL11n, ItemAttributeTypeL11nMapper::class, 'attr_type_l11n', $request->getOrigin());
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Attribute type localization', 'Attribute type localization successfully created', $attrL11n); $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Attribute type localization', 'Attribute type localization successfully created', $attrL11n);
} }
@ -221,7 +221,7 @@ final class ApiController extends Controller
$attrL11n->setLanguage((string) ( $attrL11n->setLanguage((string) (
$request->getData('language') ?? $request->getLanguage() $request->getData('language') ?? $request->getLanguage()
)); ));
$attrL11n->setTitle((string) ($request->getData('title') ?? '')); $attrL11n->title = (string) ($request->getData('title') ?? '');
return $attrL11n; return $attrL11n;
} }
@ -264,21 +264,21 @@ final class ApiController extends Controller
{ {
if (!empty($val = $this->validateItemAttributeTypeCreate($request))) { if (!empty($val = $this->validateItemAttributeTypeCreate($request))) {
$response->set('attr_type_create', new FormValidation($val)); $response->set('attr_type_create', new FormValidation($val));
$response->getHeader()->setStatusCode(RequestStatusCode::R_400); $response->header->status = RequestStatusCode::R_400;
return; return;
} }
$attrType = $this->createItemAttributeTypeFromRequest($request); $attrType = $this->createItemAttributeTypeFromRequest($request);
$this->createModel($request->getHeader()->getAccount(), $attrType, ItemAttributeTypeMapper::class, 'attr_type', $request->getOrigin()); $this->createModel($request->header->account, $attrType, ItemAttributeTypeMapper::class, 'attr_type', $request->getOrigin());
$l11nRequest = new HttpRequest($request->getUri()); $l11nRequest = new HttpRequest($request->uri);
$l11nRequest->setData('type', $attrType->getId()); $l11nRequest->setData('type', $attrType->getId());
$l11nRequest->setData('title', $request->getData('title')); $l11nRequest->setData('title', $request->getData('title'));
$l11nRequest->setData('language', $request->getData('language')); $l11nRequest->setData('language', $request->getData('language'));
$l11nAttributeType = $this->createItemAttributeTypeL11nFromRequest($l11nRequest); $l11nAttributeType = $this->createItemAttributeTypeL11nFromRequest($l11nRequest);
$this->createModel($request->getHeader()->getAccount(), $l11nAttributeType, ItemAttributeTypeL11nMapper::class, 'attr_type_l11n_create', $request->getOrigin()); $this->createModel($request->header->account, $l11nAttributeType, ItemAttributeTypeL11nMapper::class, 'attr_type_l11n_create', $request->getOrigin());
$attrType->setL11n($l11nAttributeType); $attrType->setL11n($l11nAttributeType);
@ -297,7 +297,7 @@ final class ApiController extends Controller
private function createItemAttributeTypeFromRequest(RequestAbstract $request) : ItemAttributeType private function createItemAttributeTypeFromRequest(RequestAbstract $request) : ItemAttributeType
{ {
$attrType = new ItemAttributeType(); $attrType = new ItemAttributeType();
$attrType->setName((string) ($request->getData('name') ?? '')); $attrType->setL11n((string) ($request->getData('name') ?? ''));
$attrType->setFields((int) ($request->getData('fields') ?? 0)); $attrType->setFields((int) ($request->getData('fields') ?? 0));
$attrType->setCustom((bool) ($request->getData('custom') ?? false)); $attrType->setCustom((bool) ($request->getData('custom') ?? false));
@ -342,17 +342,17 @@ final class ApiController extends Controller
{ {
if (!empty($val = $this->validateItemAttributeValueCreate($request))) { if (!empty($val = $this->validateItemAttributeValueCreate($request))) {
$response->set('attr_value_create', new FormValidation($val)); $response->set('attr_value_create', new FormValidation($val));
$response->getHeader()->setStatusCode(RequestStatusCode::R_400); $response->header->status = RequestStatusCode::R_400;
return; return;
} }
$attrValue = $this->createItemAttributeValueFromRequest($request); $attrValue = $this->createItemAttributeValueFromRequest($request);
$this->createModel($request->getHeader()->getAccount(), $attrValue, ItemAttributeValueMapper::class, 'attr_value', $request->getOrigin()); $this->createModel($request->header->account, $attrValue, ItemAttributeValueMapper::class, 'attr_value', $request->getOrigin());
if ($attrValue->isDefault()) { if ($attrValue->isDefault()) {
$this->createModelRelation( $this->createModelRelation(
$request->getHeader()->getAccount(), $request->header->account,
(int) $request->getData('attributetype'), (int) $request->getData('attributetype'),
$attrValue->getId(), $attrValue->getId(),
ItemAttributeTypeMapper::class, 'defaults', '', $request->getOrigin() ItemAttributeTypeMapper::class, 'defaults', '', $request->getOrigin()
@ -394,7 +394,7 @@ final class ApiController extends Controller
} }
if ($request->hasData('country')) { if ($request->hasData('country')) {
$attrValue->setCountry((string) ($request->getData('country') ?? $request->getHeader()->getL11n()->getCountry())); $attrValue->setCountry((string) ($request->getData('country') ?? $request->header->l11n->getCountry()));
} }
return $attrValue; return $attrValue;
@ -438,13 +438,13 @@ final class ApiController extends Controller
{ {
if (!empty($val = $this->validateItemL11nTypeCreate($request))) { if (!empty($val = $this->validateItemL11nTypeCreate($request))) {
$response->set('item_l11n_type_create', new FormValidation($val)); $response->set('item_l11n_type_create', new FormValidation($val));
$response->getHeader()->setStatusCode(RequestStatusCode::R_400); $response->header->status = RequestStatusCode::R_400;
return; return;
} }
$itemL11nType = $this->createItemL11nTypeFromRequest($request); $itemL11nType = $this->createItemL11nTypeFromRequest($request);
$this->createModel($request->getHeader()->getAccount(), $itemL11nType, ItemL11nTypeMapper::class, 'item_l11n_type', $request->getOrigin()); $this->createModel($request->header->account, $itemL11nType, ItemL11nTypeMapper::class, 'item_l11n_type', $request->getOrigin());
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Item localization type', 'Item localization type successfully created', $itemL11nType); $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Item localization type', 'Item localization type successfully created', $itemL11nType);
} }
@ -460,7 +460,7 @@ final class ApiController extends Controller
private function createItemL11nTypeFromRequest(RequestAbstract $request) : ItemL11nType private function createItemL11nTypeFromRequest(RequestAbstract $request) : ItemL11nType
{ {
$itemL11nType = new ItemL11nType(); $itemL11nType = new ItemL11nType();
$itemL11nType->setTitle((string) ($request->getData('title') ?? '')); $itemL11nType->title = (string) ($request->getData('title') ?? '');
return $itemL11nType; return $itemL11nType;
} }
@ -501,13 +501,13 @@ final class ApiController extends Controller
{ {
if (!empty($val = $this->validateItemL11nCreate($request))) { if (!empty($val = $this->validateItemL11nCreate($request))) {
$response->set('item_l11n_create', new FormValidation($val)); $response->set('item_l11n_create', new FormValidation($val));
$response->getHeader()->setStatusCode(RequestStatusCode::R_400); $response->header->status = RequestStatusCode::R_400;
return; return;
} }
$itemL11n = $this->createItemL11nFromRequest($request); $itemL11n = $this->createItemL11nFromRequest($request);
$this->createModel($request->getHeader()->getAccount(), $itemL11n, ItemL11nMapper::class, 'item_l11n', $request->getOrigin()); $this->createModel($request->header->account, $itemL11n, ItemL11nMapper::class, 'item_l11n', $request->getOrigin());
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Item localization', 'Item localization successfully created', $itemL11n); $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Item localization', 'Item localization successfully created', $itemL11n);
} }
@ -528,7 +528,7 @@ final class ApiController extends Controller
$itemL11n->setLanguage((string) ( $itemL11n->setLanguage((string) (
$request->getData('language') ?? $request->getLanguage() $request->getData('language') ?? $request->getLanguage()
)); ));
$itemL11n->setDescription((string) ($request->getData('description') ?? '')); $itemL11n->description = (string) ($request->getData('description') ?? '');
return $itemL11n; return $itemL11n;
} }
@ -574,7 +574,7 @@ final class ApiController extends Controller
if (empty($uploadedFiles)) { if (empty($uploadedFiles)) {
$this->fillJsonResponse($request, $response, NotificationLevel::ERROR, 'Item', 'Invalid item image', $uploadedFiles); $this->fillJsonResponse($request, $response, NotificationLevel::ERROR, 'Item', 'Invalid item image', $uploadedFiles);
$response->getHeader()->setStatusCode(RequestStatusCode::R_400); $response->header->status = RequestStatusCode::R_400;
return; return;
} }
@ -582,7 +582,7 @@ final class ApiController extends Controller
$uploaded = $this->app->moduleManager->get('Media')->uploadFiles( $uploaded = $this->app->moduleManager->get('Media')->uploadFiles(
$request->getData('name') ?? '', $request->getData('name') ?? '',
$uploadedFiles, $uploadedFiles,
$request->getHeader()->getAccount(), $request->header->account,
'Modules/Media/Files/Modules/ItemManagement/' . ($request->getData('item') ?? '0'), 'Modules/Media/Files/Modules/ItemManagement/' . ($request->getData('item') ?? '0'),
'/Modules/ItemManagement/' . ($request->getData('item') ?? '0'), '/Modules/ItemManagement/' . ($request->getData('item') ?? '0'),
$request->getData('type') ?? '', $request->getData('type') ?? '',
@ -592,7 +592,7 @@ final class ApiController extends Controller
); );
$this->createModelRelation( $this->createModelRelation(
$request->getHeader()->getAccount(), $request->header->account,
(int) $request->getData('item'), (int) $request->getData('item'),
\reset($uploaded)->getId(), \reset($uploaded)->getId(),
ItemMapper::class, 'files', '', $request->getOrigin() ItemMapper::class, 'files', '', $request->getOrigin()

View File

@ -41,7 +41,7 @@ class Item
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private string $number = ''; public string $number = '';
private $successor = 0; private $successor = 0;
@ -83,7 +83,7 @@ class Item
* @var \DateTimeImmutable * @var \DateTimeImmutable
* @since 1.0.0 * @since 1.0.0
*/ */
private \DateTimeImmutable $createdAt; public \DateTimeImmutable $createdAt;
private $info = ''; private $info = '';
@ -109,18 +109,6 @@ class Item
return $this->id; return $this->id;
} }
/**
* Get created at date time
*
* @return \DateTimeImmutable
*
* @since 1.0.0
*/
public function getCreatedAt() : \DateTimeImmutable
{
return $this->createdAt;
}
/** /**
* Set the successor item * Set the successor item
* *
@ -145,32 +133,6 @@ class Item
return $this->successor; return $this->successor;
} }
/**
* Get the item number
*
* @return string
*
* @since 1.0.0
*/
public function getNumber() : string
{
return $this->number;
}
/**
* Set the item number
*
* @param string $number Number
*
* @return void
*
* @since 1.0.0
*/
public function setNumber(string $number) : void
{
$this->number = $number;
}
/** /**
* Add item l11n * Add item l11n
* *
@ -197,7 +159,7 @@ class Item
public function getL11n(string $type) : ItemL11n public function getL11n(string $type) : ItemL11n
{ {
foreach ($this->l11n as $l11n) { foreach ($this->l11n as $l11n) {
if ($l11n->getType()->getTitle() === $type) { if ($l11n->getType()->title === $type) {
return $l11n; return $l11n;
} }
} }
@ -231,7 +193,7 @@ class Item
public function getFileByType(string $type) : Media public function getFileByType(string $type) : Media
{ {
foreach ($this->files as $file) { foreach ($this->files as $file) {
if ($file->getType() === $type) { if ($file->type === $type) {
return $file; return $file;
} }
} }
@ -252,7 +214,7 @@ class Item
{ {
$files = []; $files = [];
foreach ($this->files as $file) { foreach ($this->files as $file) {
if ($file->getType() === $type) { if ($file->type === $type) {
$files[] = $file; $files[] = $file;
} }
} }

View File

@ -82,7 +82,7 @@ class ItemAttributeType implements \JsonSerializable, ArrayableInterface
*/ */
public function __construct(string $name = '') public function __construct(string $name = '')
{ {
$this->name = $name; $this->setL11n($name);
} }
/** /**
@ -97,20 +97,6 @@ class ItemAttributeType implements \JsonSerializable, ArrayableInterface
return $this->id; return $this->id;
} }
/**
* Set name
*
* @param string $name Name
*
* @return void
*
* @since 1.0.0
*/
public function setName(string $name) : void
{
$this->name = $name;
}
/** /**
* Set l11n * Set l11n
* *
@ -126,10 +112,10 @@ class ItemAttributeType implements \JsonSerializable, ArrayableInterface
if ($l11n instanceof ItemAttributeTypeL11n) { if ($l11n instanceof ItemAttributeTypeL11n) {
$this->l11n = $l11n; $this->l11n = $l11n;
} elseif ($this->l11n instanceof ItemAttributeTypeL11n && \is_string($l11n)) { } elseif ($this->l11n instanceof ItemAttributeTypeL11n && \is_string($l11n)) {
$this->l11n->setl11n($l11n); $this->l11n->title = $l11n;
} elseif (\is_string($l11n)) { } elseif (\is_string($l11n)) {
$this->l11n = new ItemAttributeTypeL11n(); $this->l11n = new ItemAttributeTypeL11n();
$this->l11n->setl11n($l11n); $this->l11n->title = $l11n;
$this->l11n->setLanguage($lang); $this->l11n->setLanguage($lang);
} }
} }

View File

@ -57,7 +57,7 @@ class ItemAttributeTypeL11n implements \JsonSerializable, ArrayableInterface
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private string $title = ''; public string $title = '';
/** /**
* Constructor. * Constructor.
@ -99,18 +99,6 @@ class ItemAttributeTypeL11n implements \JsonSerializable, ArrayableInterface
return $this->type; return $this->type;
} }
/**
* Get attribute title
*
* @return string
*
* @since 1.0.0
*/
public function getTitle() : string
{
return $this->title;
}
/** /**
* Set type. * Set type.
* *
@ -139,20 +127,6 @@ class ItemAttributeTypeL11n implements \JsonSerializable, ArrayableInterface
$this->language = $language; $this->language = $language;
} }
/**
* Set title
*
* @param string $title Title
*
* @return void
*
* @since 1.0.0
*/
public function setTitle(string $title) : void
{
$this->title = $title;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View File

@ -65,7 +65,7 @@ class ItemL11n implements \JsonSerializable, ArrayableInterface
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private string $description = ''; public string $description = '';
/** /**
* Constructor. * Constructor.
@ -173,32 +173,6 @@ class ItemL11n implements \JsonSerializable, ArrayableInterface
$this->language = $language; $this->language = $language;
} }
/**
* Get item description.
*
* @return string
*
* @since 1.0.0
*/
public function getDescription() : string
{
return $this->description;
}
/**
* Set description
*
* @param string $description Description
*
* @return void
*
* @since 1.0.0
*/
public function setDescription(string $description) : void
{
$this->description = $description;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View File

@ -40,7 +40,7 @@ class ItemL11nType implements \JsonSerializable, ArrayableInterface
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected string $title = ''; public string $title = '';
/** /**
* Constructor. * Constructor.
@ -66,32 +66,6 @@ class ItemL11nType implements \JsonSerializable, ArrayableInterface
return $this->id; return $this->id;
} }
/**
* Get title
*
* @return string
*
* @since 1.0.0
*/
public function getTitle() : string
{
return $this->title;
}
/**
* Set title
*
* @param string $title title
*
* @return void
*
* @since 1.0.0
*/
public function setTitle(string $title) : void
{
$this->title = $title;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View File

@ -37,7 +37,7 @@ echo $this->getData('nav')->render(); ?>
</ul> </ul>
</div> </div>
<div class="tab-content"> <div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-6 col-lg-4"> <div class="col-xs-12 col-md-6 col-lg-4">
@ -93,7 +93,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</div> </div>
</div> </div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box w-33 floatLeft"> <section class="box w-33 floatLeft">
<header><h1><?= $this->getHtml('Property'); ?></h1></header> <header><h1><?= $this->getHtml('Property'); ?></h1></header>
@ -211,7 +211,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-4" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-4' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-4" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box w-33 floatLeft"> <section class="box w-33 floatLeft">
<header><h1><?= $this->getHtml('Sales'); ?></h1></header> <header><h1><?= $this->getHtml('Sales'); ?></h1></header>
@ -289,7 +289,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-5" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-5' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-5" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box w-33 floatLeft"> <section class="box w-33 floatLeft">
<header><h1><?= $this->getHtml('Purchase'); ?></h1></header> <header><h1><?= $this->getHtml('Purchase'); ?></h1></header>
@ -388,7 +388,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-6" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-6' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-6" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-6' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box w-33 floatLeft"> <section class="box w-33 floatLeft">
<header><h1><?= $this->getHtml('Accounting'); ?></h1></header> <header><h1><?= $this->getHtml('Accounting'); ?></h1></header>
@ -409,7 +409,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-7" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-7' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-7" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-7' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box w-33 floatLeft"> <section class="box w-33 floatLeft">
<header><h1><?= $this->getHtml('Production'); ?></h1></header> <header><h1><?= $this->getHtml('Production'); ?></h1></header>
@ -439,7 +439,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-8" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-8' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-8" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-8' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box w-33 floatLeft"> <section class="box w-33 floatLeft">
<header><h1><?= $this->getHtml('StockList'); ?></h1></header> <header><h1><?= $this->getHtml('StockList'); ?></h1></header>
@ -457,7 +457,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-9" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-9' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-9" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-9' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box w-33 floatLeft"> <section class="box w-33 floatLeft">
<header><h1><?= $this->getHtml('QM'); ?></h1></header> <header><h1><?= $this->getHtml('QM'); ?></h1></header>
@ -470,7 +470,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-10" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-10' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-10" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-10' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box w-33 floatLeft"> <section class="box w-33 floatLeft">
<header><h1><?= $this->getHtml('Packaging'); ?></h1></header> <header><h1><?= $this->getHtml('Packaging'); ?></h1></header>
@ -502,7 +502,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-11" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-11' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-11" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-11' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box w-33 floatLeft"> <section class="box w-33 floatLeft">
<header><h1><?= $this->getHtml('Media'); ?></h1></header> <header><h1><?= $this->getHtml('Media'); ?></h1></header>
@ -518,7 +518,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-12" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-12' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-12" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-12' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box w-33 floatLeft"> <section class="box w-33 floatLeft">
<header><h1><?= $this->getHtml('Stock'); ?></h1></header> <header><h1><?= $this->getHtml('Stock'); ?></h1></header>
@ -555,7 +555,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-13" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-13' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-13" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-13' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box w-33 floatLeft"> <section class="box w-33 floatLeft">
<header><h1><?= $this->getHtml('Disposal'); ?></h1></header> <header><h1><?= $this->getHtml('Disposal'); ?></h1></header>
@ -568,7 +568,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-14" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-14' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-14" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-14' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box w-33 floatLeft"> <section class="box w-33 floatLeft">
<header><h1><?= $this->getHtml('Files'); ?></h1></header> <header><h1><?= $this->getHtml('Files'); ?></h1></header>
@ -584,7 +584,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-15" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-15' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-15" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-15' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<?php <?php
$footerView = new \phpOMS\Views\PaginationView($this->l11nManager, $this->request, $this->response); $footerView = new \phpOMS\Views\PaginationView($this->l11nManager, $this->request, $this->response);
@ -608,8 +608,8 @@ echo $this->getData('nav')->render(); ?>
<tbody> <tbody>
<tr> <tr>
<td><?= $this->printHtml($this->request->getOrigin()); ?> <td><?= $this->printHtml($this->request->getOrigin()); ?>
<td><?= $this->printHtml($this->request->getHeader()->getAccount()); ?> <td><?= $this->printHtml($this->request->header->account); ?>
<td><?= $this->printHtml($this->request->getHeader()->getAccount()); ?> <td><?= $this->printHtml($this->request->header->account); ?>
<td>Creating item <td>Creating item
<td><?= $this->printHtml((new \DateTime('now'))->format('Y-m-d H:i:s')); ?> <td><?= $this->printHtml((new \DateTime('now'))->format('Y-m-d H:i:s')); ?>
</table> </table>

View File

@ -62,10 +62,10 @@ echo $this->getData('nav')->render(); ?>
src="<?= $image instanceof NullMedia ? src="<?= $image instanceof NullMedia ?
UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) .'.png') : UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) .'.png') :
UriFactory::build('{/prefix}' . $image->getPath()); ?>"></a> UriFactory::build('{/prefix}' . $image->getPath()); ?>"></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getNumber()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->number); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name1')->getDescription()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name1')->description); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name2')->getDescription()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name2')->description); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name3')->getDescription()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name3')->description); ?></a>
<td> <td>
<td> <td>
<td> <td>

View File

@ -47,7 +47,7 @@ echo $this->getData('nav')->render();
</ul> </ul>
</div> </div>
<div class="tab-content"> <div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<div class="row"> <div class="row">
<div class="col-xs-12 col-lg-3 last-lg"> <div class="col-xs-12 col-lg-3 last-lg">
@ -56,13 +56,13 @@ echo $this->getData('nav')->render();
<div class="portlet-body"> <div class="portlet-body">
<table class="layout wf-100"> <table class="layout wf-100">
<tr><td><label for="iId"><?= $this->getHtml('ID', '0', '0'); ?></label> <tr><td><label for="iId"><?= $this->getHtml('ID', '0', '0'); ?></label>
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="number" id="iId" min="1" name="id" value="<?= $this->printHtml($item->getNumber()); ?>" disabled></span> <tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="number" id="iId" min="1" name="id" value="<?= $this->printHtml($item->number); ?>" disabled></span>
<tr><td><label for="iName1"><?= $this->getHtml('Name1'); ?></label> <tr><td><label for="iName1"><?= $this->getHtml('Name1'); ?></label>
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($item->getL11n('name1')->getDescription()); ?>" spellcheck="false" required> <tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($item->getL11n('name1')->description); ?>" spellcheck="false" required>
<tr><td><label for="iName2"><?= $this->getHtml('Name2'); ?></label> <tr><td><label for="iName2"><?= $this->getHtml('Name2'); ?></label>
<tr><td><input type="text" id="iName2" name="name2" value="<?= $this->printHtml($item->getL11n('name2')->getDescription()); ?>" spellcheck="false"> <tr><td><input type="text" id="iName2" name="name2" value="<?= $this->printHtml($item->getL11n('name2')->description); ?>" spellcheck="false">
<tr><td><label for="iName3"><?= $this->getHtml('Name3'); ?></label> <tr><td><label for="iName3"><?= $this->getHtml('Name3'); ?></label>
<tr><td><input type="text" id="iName3" name="name3" value="<?= $this->printHtml($item->getL11n('name3')->getDescription()); ?>" spellcheck="false"> <tr><td><input type="text" id="iName3" name="name3" value="<?= $this->printHtml($item->getL11n('name3')->description); ?>" spellcheck="false">
</table> </table>
</div> </div>
<div class="portlet-foot"> <div class="portlet-foot">
@ -258,7 +258,7 @@ echo $this->getData('nav')->render();
<tr data-href="<?= $url; ?>"> <tr data-href="<?= $url; ?>">
<td><a href="#"><i class="fa fa-times"></i></a> <td><a href="#"><i class="fa fa-times"></i></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
<?php endforeach; ?> <?php endforeach; ?>
<?php if ($c === 0) : ?> <?php if ($c === 0) : ?>
<tr> <tr>
@ -335,7 +335,7 @@ echo $this->getData('nav')->render();
<tr data-href="<?= $url; ?>"> <tr data-href="<?= $url; ?>">
<td><a href="#"><i class="fa fa-times"></i></a> <td><a href="#"><i class="fa fa-times"></i></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
<?php endforeach; ?> <?php endforeach; ?>
<?php if ($c === 0) : ?> <?php if ($c === 0) : ?>
<tr> <tr>
@ -414,7 +414,7 @@ echo $this->getData('nav')->render();
<tr data-href="<?= $url; ?>"> <tr data-href="<?= $url; ?>">
<td><a href="#"><i class="fa fa-times"></i></a> <td><a href="#"><i class="fa fa-times"></i></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
<?php endforeach; ?> <?php endforeach; ?>
<?php if ($c === 0) : ?> <?php if ($c === 0) : ?>
<tr> <tr>
@ -544,7 +544,7 @@ echo $this->getData('nav')->render();
<tr data-href="<?= $url; ?>"> <tr data-href="<?= $url; ?>">
<td><a href="#"><i class="fa fa-times"></i></a> <td><a href="#"><i class="fa fa-times"></i></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
<?php endforeach; ?> <?php endforeach; ?>
<?php if ($c === 0) : ?> <?php if ($c === 0) : ?>
<tr> <tr>
@ -712,8 +712,8 @@ echo $this->getData('nav')->render();
<tbody> <tbody>
<tr> <tr>
<td><?= $this->printHtml($this->request->getOrigin()); ?> <td><?= $this->printHtml($this->request->getOrigin()); ?>
<td><?= $this->printHtml($this->request->getHeader()->getAccount()); ?> <td><?= $this->printHtml($this->request->header->account); ?>
<td><?= $this->printHtml($this->request->getHeader()->getAccount()); ?> <td><?= $this->printHtml($this->request->header->account); ?>
<td>Creating item <td>Creating item
<td><?= $this->printHtml((new \DateTime('now'))->format('Y-m-d H:i:s')); ?> <td><?= $this->printHtml((new \DateTime('now'))->format('Y-m-d H:i:s')); ?>
</table> </table>

View File

@ -42,8 +42,8 @@ echo $this->getData('nav')->render(); ?>
$url = \phpOMS\Uri\UriFactory::build('{/prefix}business/department/profile?{?}&id=' . $value->getId()); ?> $url = \phpOMS\Uri\UriFactory::build('{/prefix}business/department/profile?{?}&id=' . $value->getId()); ?>
<tr> <tr>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getParent()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->parent); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getUnit()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getUnit()); ?></a>
<?php endforeach; ?> <?php endforeach; ?>
<?php if ($c === 0) : ?> <?php if ($c === 0) : ?>

View File

@ -29,7 +29,7 @@ class ItemMapperTest extends \PHPUnit\Framework\TestCase
public function testCR() : void public function testCR() : void
{ {
$item = new Item(); $item = new Item();
$item->setNumber('123456789'); $item->number = '123456789';
$id = ItemMapper::create($item); $id = ItemMapper::create($item);
self::assertGreaterThan(0, $item->getId()); self::assertGreaterThan(0, $item->getId());
@ -45,7 +45,7 @@ class ItemMapperTest extends \PHPUnit\Framework\TestCase
{ {
for ($i = 0; $i < 100; ++$i) { for ($i = 0; $i < 100; ++$i) {
$item = new Item(); $item = new Item();
$item->setNumber((string) \mt_rand(100000, 999999)); $item->number = (string) \mt_rand(100000, 999999);
ItemMapper::create($item); ItemMapper::create($item);
} }