CoolCMS API

VatRate extends BaseEntity
in package
implements IdentifiableInterface uses IdentifiableTrait

AbstractYes

VAT rate (`cms_system_vat_rates`) of a supply kind in a country for a validity period.

Lookup rule in VatRateLookup.

Scalar references only (supplyKindId, countryCode): the country is referenced by its unique code, which Doctrine cannot map as an association (join columns must hit the PK).

Attributes
#[MappedSuperclass]
#[TableAlias]
$alias: 'vatRate'

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

$countryCode  : string
$id  : int|null
$note  : string|null
$percents  : string
$supplyKindId  : int
$validFrom  : DateTime
$validTo  : DateTime|null

Methods

__construct()  : mixed
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getCountryCode()  : string
getId()  : int|null
getNote()  : string|null
getPercents()  : string
getSupplyKindId()  : int
getValidFrom()  : DateTime
getValidTo()  : DateTime|null
isPersisted()  : bool
setCountryCode()  : $this
setId()  : $this
setNote()  : $this
setPercents()  : $this
setSupplyKindId()  : $this
setValidFrom()  : $this
setValidTo()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$countryCode

protected string $countryCode = ''
Attributes
#[Column]
$name: 'country_code'
$type: 'string'
$length: 2
$options: ['fixed' => true]

$id

protected int|null $id = null
Attributes
#[Column]
$name: 'vat_rate_id'
$type: 'integer'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

$note

protected string|null $note = null
Attributes
#[Column]
$name: 'note'
$type: 'string'
$length: 255
$nullable: true

$percents

protected string $percents = '0.00'
Attributes
#[Column]
$name: 'percents'
$type: 'decimal'
$precision: 5
$scale: 2

$supplyKindId

protected int $supplyKindId = 0
Attributes
#[Column]
$name: 'cms_system_supply_kinds_supply_kind_id'
$type: 'integer'
$options: ['unsigned' => true]

$validFrom

protected DateTime $validFrom = new DateTime()
Attributes
#[Column]
$name: 'valid_from'
$type: 'date'

$validTo

protected DateTime|null $validTo = null
Attributes
#[Column]
$name: 'valid_to'
$type: 'date'
$nullable: true

Methods

__construct()

public __construct([int|null $id = null ][, int $supplyKindId = 0 ][, string $countryCode = '' ][, string $percents = '0.00' ][, DateTime $validFrom = new DateTime() ][, DateTime|null $validTo = null ][, string|null $note = null ]) : mixed
Parameters
$id : int|null = null
$supplyKindId : int = 0
$countryCode : string = ''
$percents : string = '0.00'
$validFrom : DateTime = new DateTime()
$validTo : DateTime|null = null
$note : string|null = null

callInitMethods()

Calls `init{TraitName}()` for every used trait that defines such a method.

public callInitMethods() : void

getAllTraits()

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>

getCountryCode()

public getCountryCode() : string
Return values
string

getNote()

public getNote() : string|null
Return values
string|null

getPercents()

public getPercents() : string
Return values
string

getSupplyKindId()

public getSupplyKindId() : int
Return values
int

getValidFrom()

public getValidFrom() : DateTime
Return values
DateTime

getValidTo()

public getValidTo() : DateTime|null
Return values
DateTime|null

setCountryCode()

public setCountryCode(string $countryCode) : $this
Parameters
$countryCode : string
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setNote()

public setNote(string|null $note) : $this
Parameters
$note : string|null
Return values
$this

setPercents()

public setPercents(string $percents) : $this
Parameters
$percents : string
Return values
$this

setSupplyKindId()

public setSupplyKindId(int $supplyKindId) : $this
Parameters
$supplyKindId : int
Return values
$this

setValidFrom()

public setValidFrom(DateTime $validFrom) : $this
Parameters
$validFrom : DateTime
Return values
$this

setValidTo()

public setValidTo(DateTime|null $validTo) : $this
Parameters
$validTo : DateTime|null
Return values
$this

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>
Return values
array<string, string>
On this page

Search results