/** * Magic accessor for image collections. */ public function __get($name) { if (!isset($this->collections[$name])) { return parent::__get($name); } return $this->getCollection($name); }
/** * Redefine magic get * @param string $param * @return mixed|null */ public function __get($param) { if (array_key_exists($param, $this->_params)) { return $this->_params[$param]; } else { return parent::__get($param); } }
/** * Returns a property value based on its name. * Do not call this method. This is a PHP magic method that we override * to allow using the following syntax to read a property * <pre> * $value=$component->propertyName; * </pre> * @param string $name the property name * @return mixed the property value * @throws CException if the property is not defined * @see __set */ public function __get($name) { $getter = 'get' . $name; if (property_exists($this->getClient(), $name)) { return $this->getClient()->{$name}; } elseif (method_exists($this->getClient(), $getter)) { return $this->{$getter}(); } return parent::__get($name); }
public function __get($name) { if ($this->hasState($name)) { return $this->getState($name); } else { return parent::__get($name); } }
/** * Magic get method. If a get<Name> method exists, then it is called. * Otherwise, sent to parent * * @param string $name * @return mixed */ public function __get($name) { $name = str_replace('_', '', $name); return parent::__get($name); }
/** * @param string $strName * @return int|mixed */ public function __get($strName) { switch ($strName) { case 'attributes': return $this->model->attributes; case 'CartItems': case 'cartItems': return $this->model->cartItems; case 'Link': return $this->model->Link; case 'ItemCount': case 'itemCount': return count($this->model->cartItems); case 'TotalItemCount': case 'totalItemCount': return $this->model->TotalItemCount; case 'tax1name': case 'tax1Name': return $this->model->tax1Name; case 'formattedCartTax1': return _xls_currency($this->model->tax1); case 'tax2name': case 'tax2Name': return $this->model->tax2Name; case 'formattedCartTax2': return _xls_currency($this->model->tax2); case 'tax3name': case 'tax3Name': return $this->model->tax3Name; case 'formattedCartTax3': return _xls_currency($this->model->tax3); case 'tax4name': case 'tax4Name': return $this->model->tax4Name; case 'formattedCartTax4': return _xls_currency($this->model->tax4); case 'tax5name': case 'tax5Name': return $this->model->tax5Name; case 'formattedCartTax5': return _xls_currency($this->model->tax5); case 'tax_total': case 'TaxTotal': return $this->model->TaxTotal; case 'taxTotalFormatted': return _xls_currency($this->model->TaxTotal); case 'subtotal': if (empty($this->model->subtotal)) { return 0; } return $this->model->subtotal; case 'subtotalFormatted': if (empty($this->model->subtotal)) { return ''; } return _xls_currency($this->model->subtotal); case 'Taxes': return $this->model->Taxes; case 'Total': return $this->total; case 'TotalFormatted': case 'totalFormatted': return _xls_currency($this->total); case 'TotalDiscount': case 'totalDiscount': return $this->model->totalDiscount; case 'TotalDiscountFormatted': case 'totalDiscountFormatted': return $this->model->totalDiscountFormatted; case 'Length': return $this->model->Length; case 'Height': return $this->model->Height; case 'Width': return $this->model->Width; case 'Weight': return $this->model->Weight; case 'Pending': return $this->model->Pending; case 'HasShippableGift': return $this->model->HasShippableGift; case 'GiftAddress': return $this->model->GiftAddress; case 'shipping_sell': if ($this->model->shipping) { return $this->model->shipping->shipping_sell; } return 0; case 'formattedShippingCharge': if ($this->model && $this->model->shipping) { return _xls_currency($this->model->shippingCharge); } return _xls_currency(0); case 'shippingCharge': return $this->model->shippingCharge; case 'customer': if ($this->model->customer) { return $this->model->customer; } return null; case 'payment': if ($this->model->payment) { return $this->model->payment; } return null; case 'shipping': if ($this->model->shipping) { return $this->model->shipping; } return null; case 'billaddress': if ($this->model->billaddress) { return $this->model->billaddress; } return null; case 'shipaddress': if ($this->model->shipaddress) { return $this->model->shipaddress; } return null; case 'originalSubTotal': return self::calculateOriginalSubtotal(); default: // As a clever trick to get to our model through the component. if (isset($this->model) && $strName != "model" && $this->model->hasAttribute($strName)) { return $this->model->{$strName}; } return parent::__get($strName); } }
/** * PHP magic method. * This method is overriden so that persistent states can be accessed * like properties. * * @param string $name property name * * @return mixed property value */ public function __get($name) { if ($this->getUserData($name)) { return $this->getUserData($name); } else { return parent::__get($name); } }