diff --git a/Models/AccountRelation.php b/Models/AccountRelation.php index 57f9fe4..80fb2d3 100755 --- a/Models/AccountRelation.php +++ b/Models/AccountRelation.php @@ -33,7 +33,7 @@ class AccountRelation * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Promotion diff --git a/Models/Event.php b/Models/Event.php index e673ed7..95e3a15 100755 --- a/Models/Event.php +++ b/Models/Event.php @@ -20,8 +20,8 @@ use Modules\Calendar\Models\Calendar; use Modules\Media\Models\Media; use Modules\Tasks\Models\NullTask; use Modules\Tasks\Models\Task; -use phpOMS\Localization\Money; use phpOMS\Stdlib\Base\Exception\InvalidEnumValue; +use phpOMS\Stdlib\Base\FloatInt; /** * Event class. @@ -39,7 +39,7 @@ class Event * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Type. @@ -47,7 +47,7 @@ class Event * @var int * @since 1.0.0 */ - private int $type = EventType::DEFAULT; + public int $type = EventType::DEFAULT; /** * Event start. @@ -92,34 +92,34 @@ class Event /** * Costs. * - * @var Money + * @var FloatInt * @since 1.0.0 */ - public Money $budgetCosts; + public FloatInt $budgetCosts; /** * Earnings. * - * @var Money + * @var FloatInt * @since 1.0.0 */ - public Money $budgetEarnings; + public FloatInt $budgetEarnings; /** * Costs. * - * @var Money + * @var FloatInt * @since 1.0.0 */ - public Money $actualCosts; + public FloatInt $actualCosts; /** * Earnings. * - * @var Money + * @var FloatInt * @since 1.0.0 */ - public Money $actualEarnings; + public FloatInt $actualEarnings; /** * Tasks. @@ -197,10 +197,10 @@ class Event $this->start = new \DateTime('now'); $this->end = (new \DateTime('now'))->modify('+1 month'); $this->calendar = new Calendar(); - $this->budgetCosts = new Money(); - $this->budgetEarnings = new Money(); - $this->actualCosts = new Money(); - $this->actualEarnings = new Money(); + $this->budgetCosts = new FloatInt(); + $this->budgetEarnings = new FloatInt(); + $this->actualCosts = new FloatInt(); + $this->actualEarnings = new FloatInt(); $this->createdAt = new \DateTimeImmutable('now'); $this->createdBy = new NullAccount(); diff --git a/Models/EventAttribute.php b/Models/EventAttribute.php index 2da7de3..fd7aa91 100755 --- a/Models/EventAttribute.php +++ b/Models/EventAttribute.php @@ -30,7 +30,7 @@ class EventAttribute implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Event this attribute belongs to diff --git a/Models/EventAttributeType.php b/Models/EventAttributeType.php index 838cbff..ca5fe9b 100755 --- a/Models/EventAttributeType.php +++ b/Models/EventAttributeType.php @@ -34,7 +34,7 @@ class EventAttributeType implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Name/string identifier by which it can be found/categorized diff --git a/Models/EventAttributeValue.php b/Models/EventAttributeValue.php index 91e9e40..85730c5 100755 --- a/Models/EventAttributeValue.php +++ b/Models/EventAttributeValue.php @@ -36,7 +36,7 @@ class EventAttributeValue implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Depending attribute type diff --git a/Theme/Backend/eventmanagement-list.tpl.php b/Theme/Backend/eventmanagement-list.tpl.php index bd7b1a7..0893221 100755 --- a/Theme/Backend/eventmanagement-list.tpl.php +++ b/Theme/Backend/eventmanagement-list.tpl.php @@ -34,7 +34,7 @@ echo $this->getData('nav')->render(); ?> getHtml('End'); ?> $value) : ++$count; - $url = \phpOMS\Uri\UriFactory::build('eventmanagement/profile?{?}&id=' . $value->getId()); ?> + $url = \phpOMS\Uri\UriFactory::build('eventmanagement/profile?{?}&id=' . $value->id); ?> printHtml($value->name); ?> printHtml($value->getStart()->format('Y-m-d')); ?> diff --git a/tests/Models/EventMapperTest.php b/tests/Models/EventMapperTest.php index 125b5f3..501d064 100755 --- a/tests/Models/EventMapperTest.php +++ b/tests/Models/EventMapperTest.php @@ -76,10 +76,10 @@ final class EventMapperTest extends \PHPUnit\Framework\TestCase $event->addMedia($media); $id = EventMapper::create()->execute($event); - self::assertGreaterThan(0, $event->getId()); - self::assertEquals($id, $event->getId()); + self::assertGreaterThan(0, $event->id); + self::assertEquals($id, $event->id); - $eventR = EventMapper::get()->with('tasks')->with('media')->where('id', $event->getId())->execute(); + $eventR = EventMapper::get()->with('tasks')->with('media')->where('id', $event->id)->execute(); self::assertEquals($event->name, $eventR->name); self::assertEquals($event->description, $eventR->description); diff --git a/tests/Models/EventTest.php b/tests/Models/EventTest.php index a09277f..ed87844 100755 --- a/tests/Models/EventTest.php +++ b/tests/Models/EventTest.php @@ -19,7 +19,7 @@ use Modules\EventManagement\Models\EventType; use Modules\EventManagement\Models\ProgressType; use Modules\Media\Models\Media; use Modules\Tasks\Models\Task; -use phpOMS\Localization\Money; +use phpOMS\Stdlib\Base\FloatInt; /** * @internal @@ -42,7 +42,7 @@ final class EventTest extends \PHPUnit\Framework\TestCase */ public function testDefault() : void { - self::assertEquals(0, $this->event->getId()); + self::assertEquals(0, $this->event->id); self::assertEquals(EventType::DEFAULT, $this->event->getType()); self::assertInstanceOf('\Modules\Calendar\Models\Calendar', $this->event->calendar); self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->event->start->format('Y-m-d')); @@ -154,10 +154,10 @@ final class EventTest extends \PHPUnit\Framework\TestCase 'end' => $this->event->end, 'name' => 'Name', 'description' => 'Description', - 'budgetCosts' => new Money(), - 'budgetEarnings' => new Money(), - 'actualCosts' => new Money(), - 'actualEarnings' => new Money(), + 'budgetCosts' => new FloatInt(), + 'budgetEarnings' => new FloatInt(), + 'actualCosts' => new FloatInt(), + 'actualEarnings' => new FloatInt(), 'tasks' => [], 'media' => [], 'progress' => 10,