当前位置: 首页>>代码示例>>PHP>>正文


PHP CApplicationComponent::__get方法代码示例

本文整理汇总了PHP中CApplicationComponent::__get方法的典型用法代码示例。如果您正苦于以下问题:PHP CApplicationComponent::__get方法的具体用法?PHP CApplicationComponent::__get怎么用?PHP CApplicationComponent::__get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CApplicationComponent的用法示例。


在下文中一共展示了CApplicationComponent::__get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __get

 /**
  * Magic accessor for image collections.
  */
 public function __get($name)
 {
     if (!isset($this->collections[$name])) {
         return parent::__get($name);
     }
     return $this->getCollection($name);
 }
开发者ID:purnachandra,项目名称:yii-blogdemo-extended,代码行数:10,代码来源:CImageManager.php

示例2: __get

 /**
  * 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);
     }
 }
开发者ID:rash012,项目名称:cms,代码行数:13,代码来源:CConfig.php

示例3: __get

 /**
  * 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);
 }
开发者ID:hucongyang,项目名称:goddess,代码行数:22,代码来源:ARedisConnection.php

示例4: __get

 public function __get($name)
 {
     if ($this->hasState($name)) {
         return $this->getState($name);
     } else {
         return parent::__get($name);
     }
 }
开发者ID:smokeelow,项目名称:faicore,代码行数:8,代码来源:yiilite.php

示例5: __get

 /**
  * 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);
 }
开发者ID:mafiu,项目名称:listapp,代码行数:12,代码来源:GeoCoder.php

示例6: __get

 /**
  * @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':
//.........这里部分代码省略.........
开发者ID:hjlan,项目名称:webstore,代码行数:101,代码来源:ShoppingCart.php

示例7: __get

 /**
  * 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);
     }
 }
开发者ID:rhl4ttr,项目名称:hello-world,代码行数:17,代码来源:CookieWebUser.php


注:本文中的CApplicationComponent::__get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。