當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CComponent::__get方法代碼示例

本文整理匯總了PHP中CComponent::__get方法的典型用法代碼示例。如果您正苦於以下問題:PHP CComponent::__get方法的具體用法?PHP CComponent::__get怎麽用?PHP CComponent::__get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CComponent的用法示例。


在下文中一共展示了CComponent::__get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __get

 /**
  * @param string $key
  * @return mixed
  */
 public function __get($key)
 {
     if ($this->exists($key)) {
         return $this->get($key);
     }
     return parent::__get($key);
 }
開發者ID:Clarence-pan,項目名稱:org-wiki,代碼行數:11,代碼來源:Config.php

示例2: __get

 public function __get($name)
 {
     if (in_array($name, EFileMetaData::$attributeLabels)) {
         return $this->getMetaData()->getAttribute($name);
     }
     return parent::__get($name);
 }
開發者ID:sinelnikof,項目名稱:yiiext,代碼行數:7,代碼來源:EFile.php

示例3: __get

 /**
  * Getter magic method.
  * This method is overridden to support accessing application components
  * like reading module properties.
  * @param string $name application component or property name
  * @return mixed the named property value
  */
 public function __get($name)
 {
     if ($this->hasComponent($name)) {
         return $this->getComponent($name);
     } else {
         return parent::__get($name);
     }
 }
開發者ID:Jride,項目名稱:accounting-thaiconnections,代碼行數:15,代碼來源:CModule.php

示例4: __get

 /**
  * PHP getter magic method.
  * This method is overridden so that service attributes can be accessed like properties.
  *
  * @param string $name property name.
  * @return mixed property value.
  * @see getAttribute
  */
 public function __get($name)
 {
     if ($this->hasAttribute($name)) {
         return $this->getAttribute($name);
     } else {
         return parent::__get($name);
     }
 }
開發者ID:itmages,項目名稱:yii-eauth,代碼行數:16,代碼來源:EAuthServiceBase.php

示例5: __get

 /**
  * Any requests to set or get attributes or call methods on this class that 
  * are not found are redirected to the {@link Swift_Mime_Message} object.
  * @param string the attribute name
  */
 public function __get($name)
 {
     try {
         return parent::__get($name);
     } catch (CException $e) {
         $getter = 'get' . $name;
         if (method_exists($this->message, $getter)) {
             return $this->message->{$getter}();
         } else {
             throw $e;
         }
     }
 }
開發者ID:nganhtuan63,項目名稱:gxc-cms,代碼行數:18,代碼來源:YiiMailMessage.php

示例6: __get

 public function __get($name)
 {
     try {
         return parent::__get($name);
     } catch (CException $e) {
         $method_name = Yii::app()->text->underscoreToCamelcase($name);
         $method_name = 'get' . ucfirst($method_name);
         if (method_exists($this, $method_name)) {
             return $this->{$method_name}();
         } else {
             throw new CException($e->getMessage());
         }
     }
 }
開發者ID:blindest,項目名稱:Yii-CMS-2.0,代碼行數:14,代碼來源:Component.php

示例7: __get

 public function __get($name)
 {
     return parent::__get($name);
 }
開發者ID:nek-v,項目名稱:yii-esmsc,代碼行數:4,代碼來源:ESMSCProvider.php

示例8: __get

 public function __get($name)
 {
     if (isset($this->_attributes[$name])) {
         return $this->_attributes[$name];
     } else {
         if (isset($this->_match[$name])) {
             return $this->_match[$name];
         } else {
             return parent::__get($name);
         }
     }
 }
開發者ID:jerrylsxu,項目名稱:yii-sphinx,代碼行數:12,代碼來源:ESphinxResult.php

示例9: __get

 /**
  * Overrides the default magic method defined at the CComponent level in order to
  * return a metadata value if parent method fails.
  *
  * @see CComponent::__get()
  */
 public function __get($name)
 {
     try {
         return parent::__get($name);
     } catch (CException $e) {
         if (isset($this->_metadata[$name])) {
             return $this->_metadata[$name];
         } else {
             throw new SWException('Property "' . $name . '" is not found.', SWException::SW_ERR_ATTR_NOT_FOUND);
         }
     }
 }
開發者ID:honglei619,項目名稱:simpleWorkflow,代碼行數:18,代碼來源:SWNode.php

示例10: __get

 public function __get($name)
 {
     $getter = 'get' . $name;
     if (false !== method_exists($this, $getter)) {
         return call_user_func(array($this, $getter));
     } else {
         if (false !== property_exists($this, $name)) {
             return $this->{$name};
         } else {
             if (false !== $this->getIsProxy() && false !== method_exists($this->_instance, $getter)) {
                 return call_user_func(array($this->_instance, $getter));
             } else {
                 if (false !== $this->getIsProxy() && false !== property_exists($this->_instance, $name)) {
                     return $this->_instance->{$name};
                 } else {
                     if (false === $this->getIsProxy() && false !== array_key_exists($name, $this->abstract)) {
                         return $this->abstract[$name];
                     }
                 }
             }
         }
     }
     return parent::__get($name);
 }
開發者ID:raphaeldealmeida,項目名稱:Yii-Extensions,代碼行數:24,代碼來源:ProxyComponent.php

示例11: __get

 public function __get($strName)
 {
     switch ($strName) {
         case 'Name':
             return $this->name();
         case 'AdminName':
             return $this->adminName();
         case 'DefaultName':
             return $this->defaultName;
         case 'advancedMode':
             return $this->advancedMode;
         case 'modulename':
             return $this->getModuleName();
         case 'uses_credit_card':
             return $this->uses_credit_card;
         case 'uses_jumper':
             return $this->uses_jumper;
         default:
             return parent::__get($strName);
     }
 }
開發者ID:hjlan,項目名稱:webstore,代碼行數:21,代碼來源:WsExtension.php

示例12: __get

 /**
  * Overrides the default magic method defined at the CComponent level in order to
  * return a metadata value if parent method fails.
  *
  * @see CComponent::__get()
  */
 public function __get($name)
 {
     try {
         return parent::__get($name);
     } catch (CException $e) {
         if (isset($this->_metadata[$name])) {
             return $this->_metadata[$name];
         } else {
             throw new SWException(Yii::t('yii', 'Property "{property}" is not found.', array('{property}' => $name)), SWException::SW_ERR_ATTR_NOT_FOUND);
         }
     }
 }
開發者ID:asdmundt,項目名稱:templateYiiApp,代碼行數:18,代碼來源:SWNode.php

示例13: __get

 /**
  * @param string $name
  * @return mixed
  */
 public function __get($name)
 {
     $parts = explode(self::ATTRIBUTE_NAME_PREFIX, $name);
     if (count($parts) == 2 && $parts[1] != null) {
         return $this->resolveValueFromModel($parts[1]);
     }
     //Not using isset, because a null value would not resolve correctly
     if (array_key_exists($name, $this->selectedColumnNamesAndValues)) {
         return $this->selectedColumnNamesAndValues[$name];
     }
     return parent::__get($name);
 }
開發者ID:sandeep1027,項目名稱:zurmo_,代碼行數:16,代碼來源:ReportResultsRowData.php

示例14: __get

 /**
  * (non-PHPdoc)
  * @see CComponent::__get()
  */
 public function __get($name)
 {
     if (null !== $this->_results && isset($this->_results[$name])) {
         return $this->_results[$name];
     }
     return parent::__get($name);
 }
開發者ID:Diakonrus,項目名稱:fastweb-yii,代碼行數:11,代碼來源:EGeoNameService.php

示例15: __get

 public function __get($name)
 {
     if ($name == 'magic_get_prop' || $name == 'other_magic_get_prop') {
         return 'foo';
     }
     return parent::__get($name);
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:7,代碼來源:ComponentStubGeneratorTest.php


注:本文中的CComponent::__get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。