diff --git a/Admin/Install/db.json b/Admin/Install/db.json index 1b371f1..4dce617 100755 --- a/Admin/Install/db.json +++ b/Admin/Install/db.json @@ -253,11 +253,6 @@ "type": "TINYINT(1)", "null": false }, - "eventmanagement_event_attr_value_type": { - "name": "eventmanagement_event_attr_value_type", - "type": "INT(11)", - "null": false - }, "eventmanagement_event_attr_value_valueStr": { "name": "eventmanagement_event_attr_value_valueStr", "type": "VARCHAR(255)", diff --git a/Models/AccountRelationMapper.php b/Models/AccountRelationMapper.php index bd7e67d..4987ddf 100755 --- a/Models/AccountRelationMapper.php +++ b/Models/AccountRelationMapper.php @@ -42,7 +42,7 @@ final class AccountRelationMapper extends DataMapperFactory /** * Has one relation. * - * @var array + * @var array * @since 1.0.0 */ public const OWNS_ONE = [ diff --git a/Models/EventAttributeMapper.php b/Models/EventAttributeMapper.php index 291b577..323b6e4 100755 --- a/Models/EventAttributeMapper.php +++ b/Models/EventAttributeMapper.php @@ -42,7 +42,7 @@ final class EventAttributeMapper extends DataMapperFactory /** * Has one relation. * - * @var array + * @var array * @since 1.0.0 */ public const OWNS_ONE = [ diff --git a/Models/EventAttributeType.php b/Models/EventAttributeType.php index 4188eee..43eb72e 100755 --- a/Models/EventAttributeType.php +++ b/Models/EventAttributeType.php @@ -10,10 +10,12 @@ * @version 1.0.0 * @link https://jingga.app */ + declare(strict_types=1); namespace Modules\EventManagement\Models; +use phpOMS\Localization\BaseStringL11n; use phpOMS\Localization\ISO639x1Enum; /** @@ -65,9 +67,9 @@ class EventAttributeType implements \JsonSerializable /** * Localization * - * @var EventAttributeTypeL11n + * @var BaseStringL11n */ - private string | EventAttributeTypeL11n $l11n; + private string | BaseStringL11n $l11n; /** * Possible default attribute values @@ -95,7 +97,7 @@ class EventAttributeType implements \JsonSerializable * * @since 1.0.0 */ - public function getId() : int + public function getId(): int { return $this->id; } @@ -103,22 +105,23 @@ class EventAttributeType implements \JsonSerializable /** * Set l11n * - * @param string|EventAttributeTypeL11n $l11n Tag article l11n + * @param string|BaseStringL11n $l11n Tag article l11n * @param string $lang Language * * @return void * * @since 1.0.0 */ - public function setL11n(string | EventAttributeTypeL11n $l11n, string $lang = ISO639x1Enum::_EN) : void + public function setL11n(string | BaseStringL11n $l11n, string $lang = ISO639x1Enum::_EN): void { - if ($l11n instanceof EventAttributeTypeL11n) { + if ($l11n instanceof BaseStringL11n) { $this->l11n = $l11n; - } elseif (isset($this->l11n) && $this->l11n instanceof EventAttributeTypeL11n) { - $this->l11n->title = $l11n; + } elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) { + $this->l11n->content = $l11n; + $this->l11n->setLanguage($lang); } else { - $this->l11n = new EventAttributeTypeL11n(); - $this->l11n->title = $l11n; + $this->l11n = new BaseStringL11n(); + $this->l11n->content = $l11n; $this->l11n->setLanguage($lang); } } @@ -128,9 +131,9 @@ class EventAttributeType implements \JsonSerializable * * @since 1.0.0 */ - public function getL11n() : string + public function getL11n(): string { - return $this->l11n instanceof EventAttributeTypeL11n ? $this->l11n->title : $this->l11n; + return $this->l11n instanceof BaseStringL11n ? $this->l11n->content : $this->l11n; } /** @@ -142,7 +145,7 @@ class EventAttributeType implements \JsonSerializable * * @since 1.0.0 */ - public function setFields(int $fields) : void + public function setFields(int $fields): void { $this->fields = $fields; } @@ -154,7 +157,7 @@ class EventAttributeType implements \JsonSerializable * * @sicne 1.0.0 */ - public function getDefaults() : array + public function getDefaults(): array { return $this->defaults; } @@ -162,7 +165,7 @@ class EventAttributeType implements \JsonSerializable /** * {@inheritdoc} */ - public function toArray() : array + public function toArray(): array { return [ 'id' => $this->id, @@ -176,7 +179,7 @@ class EventAttributeType implements \JsonSerializable /** * {@inheritdoc} */ - public function jsonSerialize() : mixed + public function jsonSerialize(): mixed { return $this->toArray(); } diff --git a/Models/EventAttributeTypeL11nMapper.php b/Models/EventAttributeTypeL11nMapper.php index 1e080bc..8348cc5 100755 --- a/Models/EventAttributeTypeL11nMapper.php +++ b/Models/EventAttributeTypeL11nMapper.php @@ -59,7 +59,7 @@ final class EventAttributeTypeL11nMapper extends DataMapperFactory /** * Model to use by the mapper. * - * @var string + * @var class-string * @since 1.0.0 */ public const MODEL = BaseStringL11n::class; diff --git a/Models/EventAttributeTypeMapper.php b/Models/EventAttributeTypeMapper.php index 62ad38d..02be635 100755 --- a/Models/EventAttributeTypeMapper.php +++ b/Models/EventAttributeTypeMapper.php @@ -44,7 +44,7 @@ final class EventAttributeTypeMapper extends DataMapperFactory /** * Has many relation. * - * @var array + * @var array * @since 1.0.0 */ public const HAS_MANY = [ diff --git a/Models/EventAttributeValue.php b/Models/EventAttributeValue.php index af3cf55..12847e4 100755 --- a/Models/EventAttributeValue.php +++ b/Models/EventAttributeValue.php @@ -124,7 +124,7 @@ class EventAttributeValue implements \JsonSerializable /** * Set value * - * @param int|string|float|\DateTimeInterface $value Value + * @param int|string|float $value Value * * @return void * @@ -142,7 +142,7 @@ class EventAttributeValue implements \JsonSerializable } elseif ($datatype === AttributeValueType::_FLOAT) { $this->valueDec = (float) $value; } elseif ($datatype === AttributeValueType::_DATETIME) { - $this->valueDat = new \DateTime($value); + $this->valueDat = new \DateTime((string) $value); } } @@ -172,7 +172,7 @@ class EventAttributeValue implements \JsonSerializable * Set l11n * * @param string|BaseStringL11n $l11n Tag article l11n - * @param string $lang Language + * @param string $lang Language * * @return void * @@ -183,11 +183,12 @@ class EventAttributeValue implements \JsonSerializable if ($l11n instanceof BaseStringL11n) { $this->l11n = $l11n; } elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) { - $this->l11n->content = $l11n; + $this->l11n->content = $l11n; + $this->l11n->setLanguage($lang); } else { - $this->l11n = new BaseStringL11n(); + $this->l11n = new BaseStringL11n(); $this->l11n->content = $l11n; - $this->l11n->ref = $this->id; + $this->l11n->ref = $this->id; $this->l11n->setLanguage($lang); } } diff --git a/Models/EventAttributeValueMapper.php b/Models/EventAttributeValueMapper.php index 282bfc0..3f386b8 100755 --- a/Models/EventAttributeValueMapper.php +++ b/Models/EventAttributeValueMapper.php @@ -44,7 +44,7 @@ final class EventAttributeValueMapper extends DataMapperFactory /** * Has many relation. * - * @var array + * @var array * @since 1.0.0 */ /* diff --git a/Models/EventMapper.php b/Models/EventMapper.php index 6e38d34..906d228 100755 --- a/Models/EventMapper.php +++ b/Models/EventMapper.php @@ -56,7 +56,7 @@ final class EventMapper extends DataMapperFactory /** * Has many relation. * - * @var array + * @var array * @since 1.0.0 */ public const HAS_MANY = [ @@ -84,7 +84,7 @@ final class EventMapper extends DataMapperFactory /** * Has one relation. * - * @var array + * @var array * @since 1.0.0 */ public const OWNS_ONE = [ @@ -97,7 +97,7 @@ final class EventMapper extends DataMapperFactory /** * Belongs to. * - * @var array + * @var array * @since 1.0.0 */ public const BELONGS_TO = [ diff --git a/Theme/Backend/Lang/api.de.lang.php b/Theme/Backend/Lang/api.de.lang.php new file mode 100755 index 0000000..8fa0262 --- /dev/null +++ b/Theme/Backend/Lang/api.de.lang.php @@ -0,0 +1,16 @@ + [ +]];