The base class for all value objects and structs.
Supports read-only properties by marking them as protected.
In this case they will only be writable using constructor, and need to be documented
using @property-read <type> <$var>
annotation in class doc in addition to inline property doc.
Writable properties must be public and must be documented inline.
Methods
Construct object optionally with a set of properties.
|
public __construct([string|null $identifier = null ][, string|null $type = null ][, int|null $priority = null ][, bool|null $isEnabled = null ][, User|null $user = null ][, DiscountRuleInterface|null $rule = null ][, DateTimeInterface|null $startDate = null ][, array<string|int, DiscountConditionInterface> $conditions = [] ][, array<string|int, DiscountTranslationStruct> $translations = [] ][, DateTimeInterface|null $endDate = null ][, DateTimeInterface|null $createdAt = null ][, DateTimeInterface|null $updatedAt = null ][, MapInterface<string, mixed>|null $context = null ])
|
Parameters
Name |
Type |
Default value |
Description |
$identifier
|
string|null
|
null
|
-
|
$type
|
string|null
|
null
|
-
|
$priority
|
int|null
|
null
|
-
|
$isEnabled
|
bool|null
|
null
|
-
|
$user
|
User|null
|
null
|
-
|
$rule
|
DiscountRuleInterface|null
|
null
|
-
|
$startDate
|
DateTimeInterface|null
|
null
|
-
|
$conditions
|
array<string|int, DiscountConditionInterface>
|
[]
|
-
|
$translations
|
array<string|int, DiscountTranslationStruct>
|
[]
|
-
|
$endDate
|
DateTimeInterface|null
|
null
|
-
|
$createdAt
|
DateTimeInterface|null
|
null
|
-
|
$updatedAt
|
DateTimeInterface|null
|
null
|
-
|
$context
|
MapInterface<string, mixed>|null
|
null
|
-
|
Parameters
Return values
$this
Return values
array<string|int, DiscountConditionInterface>
Returns the discount context.
The context is a set of key-value pairs that can be used to store additional information about the discount.
Return values
MapInterface<string, mixed>|null
|
public getCreatedAt() : DateTimeInterface|null
|
Return values
DateTimeInterface|null
|
public getEndDate() : DateTimeInterface|null
|
Return values
DateTimeInterface|null
|
public getIdentifier() : string|null
|
Return values
string|null
|
public getPriority() : int|null
|
Return values
int|null
Return values
DiscountRuleInterface|null
|
public getStartDate() : DateTimeInterface|null
|
Return values
DateTimeInterface|null
Return values
array<string|int, DiscountTranslationStruct>
|
public getType() : string|null
|
Return values
string|null
|
public getUpdatedAt() : DateTimeInterface|null
|
Return values
DateTimeInterface|null
|
public getUser() : User|null
|
Return values
User|null
|
public isEnabled() : bool|null
|
Return values
bool|null
|
public setConditions(array<string|int, mixed> $conditions) : $this
|
Parameters
Name |
Type |
Default value |
Description |
$conditions
|
array<string|int, mixed>
|
-
|
-
|
Return values
$this
Sets the discount context.
The context is a set of key-value pairs that can be used to store additional information about the discount.
Parameters
Name |
Type |
Default value |
Description |
$context
|
MapInterface|null
|
-
|
-
|
Return values
self
|
public setCreatedAt(DateTimeInterface|null $createdAt) : $this
|
Parameters
Name |
Type |
Default value |
Description |
$createdAt
|
DateTimeInterface|null
|
-
|
-
|
Return values
$this
|
public setEnabled(bool $isEnabled) : $this
|
Parameters
Name |
Type |
Default value |
Description |
$isEnabled
|
bool
|
-
|
-
|
Return values
$this
|
public setEndDate(DateTimeInterface|null $endDate) : $this
|
Parameters
Name |
Type |
Default value |
Description |
$endDate
|
DateTimeInterface|null
|
-
|
-
|
Return values
$this
|
public setIdentifier(string $identifier) : $this
|
Parameters
Name |
Type |
Default value |
Description |
$identifier
|
string
|
-
|
-
|
Return values
$this
|
public setPriority(int $priority) : $this
|
Parameters
Name |
Type |
Default value |
Description |
$priority
|
int
|
-
|
-
|
Return values
$this
Parameters
Return values
$this
|
public setStartDate(DateTimeInterface $startDate) : $this
|
Parameters
Name |
Type |
Default value |
Description |
$startDate
|
DateTimeInterface
|
-
|
-
|
Return values
$this
Parameters
Return values
$this
|
public setType(string $type) : $this
|
Parameters
Name |
Type |
Default value |
Description |
$type
|
string
|
-
|
-
|
Return values
$this
|
public setUpdatedAt(DateTimeInterface|null $updatedAt) : $this
|
Parameters
Name |
Type |
Default value |
Description |
$updatedAt
|
DateTimeInterface|null
|
-
|
-
|
Return values
$this
|
public setUser(User $user) : $this
|
Parameters
Name |
Type |
Default value |
Description |
$user
|
User
|
-
|
-
|
Return values
$this
Returns list of available properties' names.
|
protected getProperties([array<int, string> $dynamicProperties = [] ]) : array<int, string>
|
Override to add dynamic properties.
Parameters
Name |
Type |
Default value |
Description |
$dynamicProperties
|
array<int, string>
|
[]
|
Additional dynamic properties exposed on the object
|
Return values
array<int, string>
Tags
-
Serializerignore
-