PHP Class Coupon

Inheritance: extends Illuminate\Database\Migrations\Migration
Mostrar archivo Open project: yupe/yupe Class Usage Examples

Public Methods

Method Description
afterFind ( )
attributeLabels ( ) : array
beforeSave ( ) : boolean
decreaseQuantity ( )
getCouponByCode ( $code ) : mixed
getCouponErrors ( integer $price ) : array
getDiscount ( $price ) : float
getIsAvailable ( integer $price ) : boolean
getNumberUsagesByUser ( $userId ) : string
model ( string $className = __CLASS__ ) : Coupon Returns the static model of the specified AR class.
relations ( ) : array
rules ( ) : array
scopes ( ) : array
search ( ) : CActiveDataProvider
tableName ( ) : string

Method Details

afterFind() public method

public afterFind ( )

attributeLabels() public method

public attributeLabels ( ) : array
return array customized attribute labels (name=>label)

beforeSave() public method

public beforeSave ( ) : boolean
return boolean

decreaseQuantity() public method

public decreaseQuantity ( )

getCouponByCode() public method

public getCouponByCode ( $code ) : mixed
$code
return mixed

getCouponErrors() public method

public getCouponErrors ( integer $price ) : array
$price integer
return array

getDiscount() public method

public getDiscount ( $price ) : float
$price
return float

getIsAvailable() public method

public getIsAvailable ( integer $price ) : boolean
$price integer
return boolean

getNumberUsagesByUser() public method

public getNumberUsagesByUser ( $userId ) : string
return string

model() public static method

Please note that you should have this exact method in all your CActiveRecord descendants!
public static model ( string $className = __CLASS__ ) : Coupon
$className string active record class name.
return Coupon - the static model class

relations() public method

public relations ( ) : array
return array

rules() public method

public rules ( ) : array
return array validation rules for model attributes.

scopes() public method

public scopes ( ) : array
return array

tableName() public method

public tableName ( ) : string
return string the associated database table name