CoolCMS API

UserPayment extends UserPayment
in package

After a payment is paid, `UserPaymentManager::updateStatusForPayment()` (Api, tariff-aware) updates the user: `member_until` (a tariff with `duration` > 0, monotonic) and `credits` (a tariff with `credits` > 0, additive); a package tariff does both. Order: compute validity, activate the items, extend the membership / add credits.

Admin insert is covered by afterSave().

Attributes
#[Entity]
#[Table]
$name: 'cms_system_user_payment_items'
#[TableAlias]
'userPaymentItem'

Table of Contents

Properties

$active  : bool
$id  : int|null
$insertDatetime  : DateTimeInterface|null
$insertIp  : string|null
$paymentId  : int|null
$tariffId  : int|null
$userId  : int|null
$validityDatetime  : DateTimeInterface|null

Methods

__construct()  : mixed
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getActive()  : bool
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getId()  : int|null
getInsertDatetime()  : DateTimeInterface|null
getInsertIp()  : string|null
getPaymentId()  : int|null
getTariffId()  : int|null
getUserId()  : int|null
getValidityDatetime()  : DateTimeInterface|null
isActive()  : bool
isPersisted()  : bool
setActive()  : $this
setId()  : $this
setInsertDatetime()  : $this
setInsertIp()  : $this
setPaymentId()  : $this
setTariffId()  : $this
setUserId()  : $this
setValidityDatetime()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$active

protected bool $active = true
Attributes
#[Column]
$type: "boolean"
$name: "active"
$options: ["default" => 1]

$id

protected int|null $id = null
Attributes
#[Column]
$type: "integer"
$name: "payment_item_id"
#[GeneratedValue]
#[Id]

$insertDatetime

protected DateTimeInterface|null $insertDatetime = null
Attributes
#[Column]
$type: "datetime"
$name: "insert_datetime"
#[ExternalReadonly]

$insertIp

protected string|null $insertIp = null
Attributes
#[Column]
$type: "string"
$length: 45
$name: "insert_ip"
$nullable: true
#[ExternalReadonly]
#[PersonalData]
PersonalDataKind::Hidden

$paymentId

protected int|null $paymentId = null
Attributes
#[Column]
$type: "integer"
$name: "cms_system_payments_payment_id"
$nullable: true

$tariffId

protected int|null $tariffId = null
Attributes
#[Column]
$type: "integer"
$name: "cms_system_user_tariffs_user_tariff_id"
$nullable: true

$userId

protected int|null $userId = null
Attributes
#[Column]
$type: "integer"
$name: "cms_system_users_user_id"
$nullable: true
#[ExternalReadonly]

$validityDatetime

protected DateTimeInterface|null $validityDatetime = null
Attributes
#[Column]
$type: "datetime"
$name: "validity_datetime"
$nullable: true
#[ExternalReadonly]

Methods

__construct()

public __construct([int|null $id = null ][, int|null $userId = null ][, int|null $tariffId = null ][, int|null $paymentId = null ][, DateTimeInterface|null $validityDatetime = null ][, DateTimeInterface|null $insertDatetime = null ][, string|null $insertIp = null ][, bool $active = true ]) : mixed
Parameters
$id : int|null = null
$userId : int|null = null
$tariffId : int|null = null
$paymentId : int|null = null
$validityDatetime : DateTimeInterface|null = null
$insertDatetime : DateTimeInterface|null = null
$insertIp : string|null = null
$active : bool = true

callInitMethods()

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

public callInitMethods() : void

getActive()

public getActive() : bool
Return values
bool

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>

getInsertDatetime()

public getInsertDatetime() : DateTimeInterface|null
Return values
DateTimeInterface|null

getInsertIp()

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

getPaymentId()

public getPaymentId() : int|null
Return values
int|null

getTariffId()

public getTariffId() : int|null
Return values
int|null

getUserId()

public getUserId() : int|null
Return values
int|null

getValidityDatetime()

public getValidityDatetime() : DateTimeInterface|null
Return values
DateTimeInterface|null

isActive()

public isActive() : bool
Return values
bool

setActive()

public setActive(bool $active) : $this
Parameters
$active : bool
Return values
$this

setId()

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

setInsertDatetime()

public setInsertDatetime(DateTimeInterface $insertDatetime) : $this
Parameters
$insertDatetime : DateTimeInterface
Return values
$this

setInsertIp()

public setInsertIp(string|null $insertIp) : $this
Parameters
$insertIp : string|null
Return values
$this

setPaymentId()

public setPaymentId(int|null $paymentId) : $this
Parameters
$paymentId : int|null
Return values
$this

setTariffId()

public setTariffId(int|null $tariffId) : $this
Parameters
$tariffId : int|null
Return values
$this

setUserId()

public setUserId(int $userId) : $this
Parameters
$userId : int
Return values
$this

setValidityDatetime()

public setValidityDatetime(DateTimeInterface|null $validityDatetime) : $this
Parameters
$validityDatetime : DateTimeInterface|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