Tariff
extends BaseEntity
in package
implements
IdentifiableInterface
uses
IdentifiableTrait, TranslationCollectionTrait, TariffPriceCollectionTrait, TariffQuickPriceCollectionTrait
AbstractYes
Tags
Attributes
- #[MappedSuperclass]
- #[TableAlias]
- $alias: 'Tariff'
Table of Contents
Interfaces
- IdentifiableInterface
- Entity with a simple integer primary key. Most entities have one (often via {@see \App\Core\Traits\Shared\Models\Entities\IdentifiableTrait}); texts and links with a composite key do not, which is why `getId()` is not on {@see \App\Core\Base\BaseEntity}. Code that needs the id of a generic entity asks for this interface (parameter type, template bound, `instanceof`).
Properties
- $active : bool
- $credits : int
- $duration : int
- $id : int|null
- $prices : Collection<int, TPrice>
- $productTypeId : int|null
- $quickPrices : Collection<int, TQuickPrice>
- $supplyKindId : int|null
- $translations : Collection<int, TTranslation>
- $vatPercents : numeric-string|null
Methods
- __construct() : mixed
- addPrice() : $this
- addQuickPrice() : $this
- addTranslation() : $this
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- clearPrices() : $this
- clearQuickPrices() : $this
- getActive() : bool
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getCredits() : int
- getDuration() : int
- getId() : int|null
- getPrice() : TPrice|null
- getPrices() : Collection<int, TPrice>
- getProductTypeId() : int|null
- getQuickPrice() : TQuickPrice|null
- getQuickPrices() : Collection<int, TQuickPrice>
- getSupplyKindId() : int|null
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- getVatPercents() : numeric-string|null
- isActive() : bool
- isPersisted() : bool
- removePrice() : $this
- removeQuickPrice() : $this
- removeTranslation() : $this
- setActive() : $this
- setCredits() : $this
- setDuration() : $this
- setId() : $this
- setPrices() : $this
- IMPORTANT: the parameter type must be `Collection`, not `ArrayCollection`; the keep branch of the Api `SaveTrait` passes a `PersistentCollection` from a managed entity, and a narrower type throws a `TypeError` and fails the tariff save in the admin.
- setProductTypeId() : TQuickPriceRel>
- setQuickPrices() : $this
- setSupplyKindId() : TQuickPriceRel>
- setTranslations() : $this
- setVatPercents() : TQuickPriceRel>
- tariffPriceCollectionInit() : void
- tariffQuickPriceCollectionInit() : void
- translationCollectionInit() : void
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$active
protected
bool
$active
= true
Attributes
- #[Column]
- $name: 'active'
- $type: 'boolean'
$credits
protected
int
$credits
= 0
Attributes
- #[Column]
- $name: 'credits'
- $type: 'integer'
- $options: ['unsigned' => true]
$duration
protected
int
$duration
= 0
Attributes
- #[Column]
- $name: 'duration'
- $type: 'integer'
- $options: ['unsigned' => true]
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'message_tariff_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$prices
protected
Collection<int, TPrice>
$prices
= new ArrayCollection()
$productTypeId
protected
int|null
$productTypeId
= null
Attributes
- #[Column]
- $name: 'cms_mod_invoicer_product_types_product_type_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$quickPrices
protected
Collection<int, TQuickPrice>
$quickPrices
= new ArrayCollection()
$supplyKindId
protected
int|null
$supplyKindId
= null
Attributes
- #[Column]
- $name: 'cms_system_supply_kinds_supply_kind_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$translations
protected
Collection<int, TTranslation>
$translations
= new ArrayCollection()
$vatPercents
protected
numeric-string|null
$vatPercents
= null
Attributes
- #[Column]
- $name: 'vat_percents'
- $type: 'decimal'
- $precision: 5
- $scale: 2
- $nullable: true
Methods
__construct()
public
__construct([int|null $id = null ][, int $duration = 0 ][, int $credits = 0 ][, bool $active = true ][, int|null $productTypeId = null ][, string|null $vatPercents = null ][, Collection $translations = new ArrayCollection() ][, Collection $prices = new ArrayCollection() ][, Collection $quickPrices = new ArrayCollection() ][, int|null $supplyKindId = null ]) : mixed
Parameters
- $id : int|null = null
- $duration : int = 0
- $credits : int = 0
- $active : bool = true
- $productTypeId : int|null = null
- $vatPercents : string|null = null
- $translations : Collection = new ArrayCollection()
- $prices : Collection = new ArrayCollection()
- $quickPrices : Collection = new ArrayCollection()
- $supplyKindId : int|null = null
addPrice()
public
addPrice(TPrice $price) : $this
Parameters
- $price : TPrice
Return values
$thisaddQuickPrice()
public
addQuickPrice(TQuickPrice $quickPrice) : $this
Parameters
- $quickPrice : TQuickPrice
Return values
$thisaddTranslation()
public
addTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thiscallInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
clearPrices()
public
clearPrices() : $this
Return values
$thisclearQuickPrices()
public
clearQuickPrices() : $this
Return values
$thisgetActive()
public
getActive() : bool
Return values
boolgetAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getCredits()
public
getCredits() : int
Return values
intgetDuration()
public
getDuration() : int
Return values
intgetId()
public
getId() : int|null
Return values
int|nullgetPrice()
public
getPrice([int|null $paymentRegionId = null ][, int|null $paymentGateId = null ][, int|null $currencyId = null ]) : TPrice|null
Parameters
- $paymentRegionId : int|null = null
- $paymentGateId : int|null = null
- $currencyId : int|null = null
Return values
TPrice|nullgetPrices()
public
getPrices() : Collection<int, TPrice>
Return values
Collection<int, TPrice>getProductTypeId()
public
getProductTypeId() : int|null
Return values
int|nullgetQuickPrice()
public
getQuickPrice(int $paymentRegionId) : TQuickPrice|null
Parameters
- $paymentRegionId : int
Return values
TQuickPrice|nullgetQuickPrices()
public
getQuickPrices() : Collection<int, TQuickPrice>
Return values
Collection<int, TQuickPrice>getSupplyKindId()
public
getSupplyKindId() : int|null
Return values
int|nullgetTranslation()
public
getTranslation(int $langId) : TTranslation|null
Parameters
- $langId : int
Return values
TTranslation|nullgetTranslations()
public
getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>getVatPercents()
public
getVatPercents() : numeric-string|null
Return values
numeric-string|nullisActive()
public
isActive() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolremovePrice()
public
removePrice(TPrice $price) : $this
Parameters
- $price : TPrice
Return values
$thisremoveQuickPrice()
public
removeQuickPrice(TQuickPrice $quickPrice) : $this
Parameters
- $quickPrice : TQuickPrice
Return values
$thisremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thissetActive()
public
setActive(bool $active) : $this
Parameters
- $active : bool
Return values
$thissetCredits()
public
setCredits(int $credits) : $this
Parameters
- $credits : int
Return values
$thissetDuration()
public
setDuration(int $duration) : $this
Parameters
- $duration : int
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetPrices()
IMPORTANT: the parameter type must be `Collection`, not `ArrayCollection`; the keep branch of the Api `SaveTrait` passes a `PersistentCollection` from a managed entity, and a narrower type throws a `TypeError` and fails the tariff save in the admin.
public
setPrices(Collection<int, TPrice> $prices) : $this
Parameters
- $prices : Collection<int, TPrice>
Return values
$thissetProductTypeId()
public
setProductTypeId(int|null $productTypeId) : TQuickPriceRel>
Parameters
- $productTypeId : int|null
Return values
TQuickPriceRel>setQuickPrices()
public
setQuickPrices(Collection<int, TQuickPrice>|array<int, TQuickPrice> $quickPrices) : $this
Parameters
- $quickPrices : Collection<int, TQuickPrice>|array<int, TQuickPrice>
Return values
$thissetSupplyKindId()
public
setSupplyKindId(int|null $supplyKindId) : TQuickPriceRel>
Parameters
- $supplyKindId : int|null
Return values
TQuickPriceRel>setTranslations()
public
setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
- $translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$thissetVatPercents()
public
setVatPercents(int|float|string|null $vatPercents) : TQuickPriceRel>
Parameters
- $vatPercents : int|float|string|null
Return values
TQuickPriceRel>tariffPriceCollectionInit()
public
tariffPriceCollectionInit() : void
tariffQuickPriceCollectionInit()
public
tariffQuickPriceCollectionInit() : void
translationCollectionInit()
public
translationCollectionInit() : void
getTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>