mirror of
https://github.com/Karaka-Management/oms-Marketing.git
synced 2026-02-04 04:38:42 +00:00
Extend promotion similar to eventmanagement
This commit is contained in:
parent
0e8392afe4
commit
ccac0b444d
34
Models/ProgressType.php
Normal file
34
Models/ProgressType.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.2
|
||||
*
|
||||
* @package Modules\Marketing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://website.orange-management.de
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Marketing\Models;
|
||||
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Task type enum.
|
||||
*
|
||||
* @package Modules\Marketing\Models
|
||||
* @license OMS License 1.0
|
||||
* @link http://website.orange-management.de
|
||||
* @since 1.0.0
|
||||
*/
|
||||
abstract class ProgressType extends Enum
|
||||
{
|
||||
public const MANUAL = 0;
|
||||
public const LINEAR = 1;
|
||||
public const EXPONENTIAL = 2;
|
||||
public const LOG = 3;
|
||||
public const TASKS = 4;
|
||||
}
|
||||
|
|
@ -48,6 +48,10 @@ class Promotion
|
|||
|
||||
private $media = [];
|
||||
|
||||
private $progress = 0;
|
||||
|
||||
private $progressType = ProgressType::MANUAL;
|
||||
|
||||
/**
|
||||
* Created at.
|
||||
*
|
||||
|
|
@ -152,6 +156,26 @@ class Promotion
|
|||
return $this->end;
|
||||
}
|
||||
|
||||
public function getProgress() : int
|
||||
{
|
||||
return $this->progress;
|
||||
}
|
||||
|
||||
public function setProgress(int $progress) : void
|
||||
{
|
||||
$this->progress = $progress;
|
||||
}
|
||||
|
||||
public function getProgressType() : int
|
||||
{
|
||||
return $this->progressType;
|
||||
}
|
||||
|
||||
public function setProgressType(int $type) : void
|
||||
{
|
||||
$this->progressType = $type;
|
||||
}
|
||||
|
||||
public function getCalendar() : Calendar
|
||||
{
|
||||
return $this->calendar;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ final class PromotionMapper extends DataMapperAbstract
|
|||
'marketing_promotion_earnings' => ['name' => 'marketing_promotion_earnings', 'type' => 'Serializable', 'internal' => 'earnings'],
|
||||
'marketing_promotion_start' => ['name' => 'marketing_promotion_start', 'type' => 'DateTime', 'internal' => 'start'],
|
||||
'marketing_promotion_end' => ['name' => 'marketing_promotion_end', 'type' => 'DateTime', 'internal' => 'end'],
|
||||
'marketing_promotion_progress' => ['name' => 'marketing_promotion_progress', 'type' => 'int', 'internal' => 'progress'],
|
||||
'marketing_promotion_progress_type' => ['name' => 'marketing_promotion_progress_type', 'type' => 'int', 'internal' => 'progressType'],
|
||||
'marketing_promotion_created_by' => ['name' => 'marketing_promotion_created_by', 'type' => 'int', 'internal' => 'createdBy'],
|
||||
'marketing_promotion_created_at' => ['name' => 'marketing_promotion_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user