DiscountCoupon extends ActiveRecord
This is the model class for table "discount_coupon".
Table of Contents
Constants
- OFFER_STATUS_ACTIVE = "active"
- OFFER_STATUS_EXPIRED = "expired"
- OFFER_STATUS_UPCOMING = "upcoming"
Properties
- $code : string
- $created_at : string|null
- $desc : string|null
- $discount : float
- $finish_date : string
- $fk_coupon_category : int
- $fkCouponCategory : CouponCategory
- $id : int
- $name : string
- $start_date : string
- $status : int
- $updated_at : string|null
Methods
- fields() : array<string|int, mixed>
- Desc: Columnas a utilizar de los registros
- getFkCouponCategory() : ActiveQuery
- Desc: Obtiene query para [[FkCouponCategory]].
- rules() : array<string|int, mixed>
- Desc: Reglas de validación.
- tableName() : string
- Desc: Nombre de la tabla de la base de datos.
- Verify() : float
- Desc: Retorna el porcentaje de descuento que contiene el codigo
Constants
OFFER_STATUS_ACTIVE
public
mixed
OFFER_STATUS_ACTIVE
= "active"
OFFER_STATUS_EXPIRED
public
mixed
OFFER_STATUS_EXPIRED
= "expired"
OFFER_STATUS_UPCOMING
public
mixed
OFFER_STATUS_UPCOMING
= "upcoming"
Properties
$code
public
string
$code
$created_at
public
string|null
$created_at
$desc
public
string|null
$desc
$discount
public
float
$discount
En porcentaje
$finish_date
public
string
$finish_date
Finalizacion codigo de promo
$fk_coupon_category
public
int
$fk_coupon_category
$fkCouponCategory
public
CouponCategory
$fkCouponCategory
$id
public
int
$id
$name
public
string
$name
$start_date
public
string
$start_date
Inicio del codigo de promo
$status
public
int
$status
Codigo activo/inactivo
$updated_at
public
string|null
$updated_at
Methods
fields()
Desc: Columnas a utilizar de los registros
public
fields() : array<string|int, mixed>
Notes: n/a
Ref: https://www.yiiframework.com/doc/api/2.0/yii-db-activerecord#fields()-detail
Date: 2025-08-06, Version: v0.2507.01
Example: n/a
Return values
array<string|int, mixed>getFkCouponCategory()
Desc: Obtiene query para [[FkCouponCategory]].
public
getFkCouponCategory() : ActiveQuery
Notes: n/a,
Ref: https://www.yiiframework.com/doc/api/2.0/yii-db-activequery
Date: 2025-09-05, Version: v0.2507.01
Example: n/a
Return values
ActiveQueryrules()
Desc: Reglas de validación.
public
rules() : array<string|int, mixed>
Notes: n/a
Ref: https://www.yiiframework.com/doc/api/2.0/yii-base-model#rules()-detail
Date: 2025-08-06, Version: v0.2507.01
Example: n/a
Return values
array<string|int, mixed>tableName()
Desc: Nombre de la tabla de la base de datos.
public
static tableName() : string
Notes: n/a
Ref: https://www.yiiframework.com/doc/api/2.0/yii-db-activerecord#tableName()-detail
Date: 2025-08-06, Version: v0.2507.01
Example: n/a
Return values
string —Nombre de la tabla
Verify()
Desc: Retorna el porcentaje de descuento que contiene el codigo
public
static Verify(string $code) : float
Notes: n/a, Ref: n/a
Date: 2025-08-06, Version: v0.2507.01
Example: n/a
Parameters
- $code : string
-
Código de descuento.
Return values
float —Descuento en %.