PHP 클래스 Order

상속: extends AppModel
파일 보기 프로젝트 열기: yupe/yupe 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$couponId null

보호된 프로퍼티들

프로퍼티 타입 설명
$oldAttributes

공개 메소드들

메소드 설명
afterDelete ( )
afterFind ( )
afterSave ( )
applyCoupons ( array $coupons ) : boolean
attributeLabels ( ) : array
beforeSave ( ) : boolean
beforeValidate ( ) : boolean
behaviors ( ) : array
checkManager ( IWebUser $user ) : boolean
findByNumber ( $number ) : static
findByUrl ( $url ) : static
getAddress ( ) : string
getCouponDiscount ( array $coupons ) : float Получает скидку для переданных купонов
getCoupons ( ) : mixed
getCouponsCodes ( ) : array
getDeliveryCost ( ) : integer | mixed
getDeliveryPrice ( ) : float
getPaidStatus ( ) : string
getPaidStatusList ( ) : array
getProducts ( ) : CActiveDataProvider
getProductsCost ( ) : float | integer
getStatusTitle ( ) : string
getTotalPrice ( ) : float
getTotalPriceWithDelivery ( ) : float
getValidCoupons ( $codes ) : Coupon[] Фильтрует переданные коды купонов и возвращает объекты купонов
hasCoupons ( ) : boolean
isCouponsAvailable ( ) : boolean
isPaid ( ) : boolean
isPaymentMethodSelected ( ) : mixed
isStatusChanged ( ) : boolean
model ( null | string $className = __CLASS__ )
pay ( Payment $payment, integer $paid = self::PAID_STATUS_PAID ) : boolean
relations ( ) : array
rules ( ) : array
scopes ( ) : array
search ( ) : CActiveDataProvider
searchCoupons ( ) : CActiveDataProvider
setProducts ( $orderProducts ) Формат массива:
array(
   '45' => array( //реальный id или сгенерированный новый, у новых внутри массива нет id
       'id' => '10', //если нет id, то новый
       'variant_ids' => array('10', '20, '30'), // массив с id вариантов
       'quantity' = > '5',
       'price' => '1000',
       'product_id' => '123',
   )
)
store ( array $attributes, array $products, integer $client = null, integer $status = OrderStatus::STATUS_NEW ) : boolean
tableName ( ) : string

비공개 메소드들

메소드 설명
updateOrderProducts ( $products ) Массив объектов OrderProduct

메소드 상세

afterDelete() 공개 메소드

public afterDelete ( )

afterFind() 공개 메소드

public afterFind ( )

afterSave() 공개 메소드

public afterSave ( )

applyCoupons() 공개 메소드

public applyCoupons ( array $coupons ) : boolean
$coupons array
리턴 boolean

attributeLabels() 공개 메소드

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

beforeSave() 공개 메소드

public beforeSave ( ) : boolean
리턴 boolean

beforeValidate() 공개 메소드

public beforeValidate ( ) : boolean
리턴 boolean

behaviors() 공개 메소드

public behaviors ( ) : array
리턴 array

checkManager() 공개 메소드

public checkManager ( IWebUser $user ) : boolean
$user IWebUser
리턴 boolean

findByNumber() 공개 메소드

public findByNumber ( $number ) : static
$number
리턴 static

findByUrl() 공개 메소드

public findByUrl ( $url ) : static
$url
리턴 static

getAddress() 공개 메소드

public getAddress ( ) : string
리턴 string

getCouponDiscount() 공개 메소드

Получает скидку для переданных купонов
public getCouponDiscount ( array $coupons ) : float
$coupons array Coupon[]
리턴 float - скидка

getCoupons() 공개 메소드

public getCoupons ( ) : mixed
리턴 mixed

getCouponsCodes() 공개 메소드

public getCouponsCodes ( ) : array
리턴 array

getDeliveryCost() 공개 메소드

public getDeliveryCost ( ) : integer | mixed
리턴 integer | mixed

getDeliveryPrice() 공개 메소드

public getDeliveryPrice ( ) : float
리턴 float

getPaidStatus() 공개 메소드

public getPaidStatus ( ) : string
리턴 string

getPaidStatusList() 공개 메소드

public getPaidStatusList ( ) : array
리턴 array

getProducts() 공개 메소드

public getProducts ( ) : CActiveDataProvider
리턴 CActiveDataProvider

getProductsCost() 공개 메소드

public getProductsCost ( ) : float | integer
리턴 float | integer

getStatusTitle() 공개 메소드

public getStatusTitle ( ) : string
리턴 string

getTotalPrice() 공개 메소드

public getTotalPrice ( ) : float
리턴 float

getTotalPriceWithDelivery() 공개 메소드

public getTotalPriceWithDelivery ( ) : float
리턴 float

getValidCoupons() 공개 메소드

Фильтрует переданные коды купонов и возвращает объекты купонов
public getValidCoupons ( $codes ) : Coupon[]
$codes - массив кодов купонов
리턴 Coupon[] - массив объектов-купонов

hasCoupons() 공개 메소드

public hasCoupons ( ) : boolean
리턴 boolean

isCouponsAvailable() 공개 메소드

public isCouponsAvailable ( ) : boolean
리턴 boolean

isPaid() 공개 메소드

public isPaid ( ) : boolean
리턴 boolean

isPaymentMethodSelected() 공개 메소드

public isPaymentMethodSelected ( ) : mixed
리턴 mixed

isStatusChanged() 공개 메소드

public isStatusChanged ( ) : boolean
리턴 boolean

model() 공개 정적인 메소드

public static model ( null | string $className = __CLASS__ )
$className null | string

pay() 공개 메소드

public pay ( Payment $payment, integer $paid = self::PAID_STATUS_PAID ) : boolean
$payment Payment
$paid integer
리턴 boolean

relations() 공개 메소드

public relations ( ) : array
리턴 array

rules() 공개 메소드

public rules ( ) : array
리턴 array validation rules for model attributes.

scopes() 공개 메소드

public scopes ( ) : array
리턴 array

searchCoupons() 공개 메소드

public searchCoupons ( ) : CActiveDataProvider
리턴 CActiveDataProvider

setProducts() 공개 메소드

Формат массива:
array(
   '45' => array( //реальный id или сгенерированный новый, у новых внутри массива нет id
       'id' => '10', //если нет id, то новый
       'variant_ids' => array('10', '20, '30'), // массив с id вариантов
       'quantity' = > '5',
       'price' => '1000',
       'product_id' => '123',
   )
)
public setProducts ( $orderProducts )
$orderProducts Array

store() 공개 메소드

public store ( array $attributes, array $products, integer $client = null, integer $status = OrderStatus::STATUS_NEW ) : boolean
$attributes array
$products array
$client integer
$status integer
리턴 boolean

tableName() 공개 메소드

public tableName ( ) : string
리턴 string the associated database table name

프로퍼티 상세

$couponId 공개적으로 프로퍼티

public null $couponId
리턴 null

$oldAttributes 보호되어 있는 프로퍼티

protected $oldAttributes