diff --git a/Models/AccountRelation.php b/Models/AccountRelation.php index ef6ed78..5492d4b 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/Promotion.php b/Models/Promotion.php index 2075eab..8b99661 100755 --- a/Models/Promotion.php +++ b/Models/Promotion.php @@ -20,7 +20,7 @@ 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\FloatInt; /** * Promotion class. @@ -38,7 +38,7 @@ class Promotion * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Event start. @@ -83,34 +83,34 @@ class Promotion /** * Budget costs. * - * @var Money + * @var FloatInt * @since 1.0.0 */ - public Money $budgetCosts; + public FloatInt $budgetCosts; /** * Budget earnings. * - * @var Money + * @var FloatInt * @since 1.0.0 */ - public Money $budgetEarnings; + public FloatInt $budgetEarnings; /** * Current total costs. * - * @var Money + * @var FloatInt * @since 1.0.0 */ - public Money $actualCosts; + public FloatInt $actualCosts; /** * Current total earnings. * - * @var Money + * @var FloatInt * @since 1.0.0 */ - public Money $actualEarnings; + public FloatInt $actualEarnings; /** * Tasks. @@ -188,10 +188,10 @@ class Promotion $this->start = new \DateTime('now'); $this->end = (new \DateTime('now'))->modify('+1 month'); $this->calendar = new Calendar(); - $this->actualCosts = new Money(); - $this->actualEarnings = new Money(); - $this->budgetCosts = new Money(); - $this->budgetEarnings = new Money(); + $this->actualCosts = new FloatInt(); + $this->actualEarnings = new FloatInt(); + $this->budgetCosts = new FloatInt(); + $this->budgetEarnings = new FloatInt(); $this->createdAt = new \DateTimeImmutable('now'); $this->createdBy = new NullAccount(); diff --git a/Models/PromotionAttribute.php b/Models/PromotionAttribute.php index 067dbfc..403b08f 100755 --- a/Models/PromotionAttribute.php +++ b/Models/PromotionAttribute.php @@ -30,7 +30,7 @@ class PromotionAttribute implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Promotion this attribute belongs to diff --git a/Models/PromotionAttributeType.php b/Models/PromotionAttributeType.php index 53b2e66..5605927 100755 --- a/Models/PromotionAttributeType.php +++ b/Models/PromotionAttributeType.php @@ -33,7 +33,7 @@ class PromotionAttributeType 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/PromotionAttributeValue.php b/Models/PromotionAttributeValue.php index c66abc3..a569522 100755 --- a/Models/PromotionAttributeValue.php +++ b/Models/PromotionAttributeValue.php @@ -36,7 +36,7 @@ class PromotionAttributeValue implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Depending attribute type diff --git a/Theme/Backend/promotion-list.tpl.php b/Theme/Backend/promotion-list.tpl.php index d9f7e0d..07f38bd 100755 --- a/Theme/Backend/promotion-list.tpl.php +++ b/Theme/Backend/promotion-list.tpl.php @@ -34,7 +34,7 @@ echo $this->getData('nav')->render(); ?> getHtml('Due'); ?> $value) : ++$count; - $url = \phpOMS\Uri\UriFactory::build('marketing/promotion/profile?{?}&id=' . $value->getId()); ?> + $url = \phpOMS\Uri\UriFactory::build('marketing/promotion/profile?{?}&id=' . $value->id); ?> printHtml($value->name); ?> printHtml($value->getStart()->format('Y-m-d')); ?> diff --git a/tests/Models/PromotionMapperTest.php b/tests/Models/PromotionMapperTest.php index 03283b8..eac6719 100755 --- a/tests/Models/PromotionMapperTest.php +++ b/tests/Models/PromotionMapperTest.php @@ -21,7 +21,7 @@ use Modules\Marketing\Models\PromotionMapper; use Modules\Media\Models\Media; use Modules\Tasks\Models\Task; use phpOMS\DataStorage\Database\Query\OrderType; -use phpOMS\Localization\Money; +use phpOMS\Stdlib\Base\FloatInt; /** * @internal @@ -42,7 +42,7 @@ final class PromotionMapperTest extends \PHPUnit\Framework\TestCase $promotion->start = new \DateTime('2000-05-05'); $promotion->end = new \DateTime('2005-05-05'); - $money = new Money(); + $money = new FloatInt(); $money->setString('1.23'); $promotion->budgetCosts = $money; @@ -74,13 +74,13 @@ final class PromotionMapperTest extends \PHPUnit\Framework\TestCase $promotion->addMedia($media); $id = PromotionMapper::create()->execute($promotion); - self::assertGreaterThan(0, $promotion->getId()); - self::assertEquals($id, $promotion->getId()); + self::assertGreaterThan(0, $promotion->id); + self::assertEquals($id, $promotion->id); $promotionR = PromotionMapper::get() ->with('tasks') ->with('media') - ->where('id', $promotion->getId())->execute(); + ->where('id', $promotion->id)->execute(); self::assertEquals($promotion->name, $promotionR->name); self::assertEquals($promotion->description, $promotionR->description); diff --git a/tests/Models/PromotionTest.php b/tests/Models/PromotionTest.php index 78f1ebc..fa5f70d 100755 --- a/tests/Models/PromotionTest.php +++ b/tests/Models/PromotionTest.php @@ -18,7 +18,7 @@ use Modules\Marketing\Models\ProgressType; use Modules\Marketing\Models\Promotion; use Modules\Media\Models\Media; use Modules\Tasks\Models\Task; -use phpOMS\Localization\Money; +use phpOMS\Stdlib\Base\FloatInt; /** * @internal @@ -41,7 +41,7 @@ final class PromotionTest extends \PHPUnit\Framework\TestCase */ public function testDefault() : void { - self::assertEquals(0, $this->promotion->getId()); + self::assertEquals(0, $this->promotion->id); self::assertInstanceOf('\Modules\Calendar\Models\Calendar', $this->promotion->calendar); self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->promotion->start->format('Y-m-d')); self::assertEquals((new \DateTime('now'))->modify('+1 month')->format('Y-m-d'), $this->promotion->end->format('Y-m-d')); @@ -130,10 +130,10 @@ final class PromotionTest extends \PHPUnit\Framework\TestCase 'end' => $this->promotion->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,