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


PHP Object::__get方法代碼示例

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


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

示例1: __get

 public function __get($property)
 {
     if ($this->isNestedProperty($property)) {
         return $this->getNestedProperty($property);
     }
     return parent::__get($property);
 }
開發者ID:tsamsiyu,項目名稱:yii2-over,代碼行數:7,代碼來源:ModelBase.php

示例2: __get

 /**
  * (non-PHPdoc)
  * @see \yii\base\Object::__get()
  */
 public function __get($name)
 {
     if (in_array($name, $this->options)) {
         return $this->config->{$name};
     }
     return parent::__get($name);
 }
開發者ID:yurii-github,項目名稱:yii2-mylib,代碼行數:11,代碼來源:Configuration.php

示例3: __get

 /**
  * Check whether we have a plugin installed with that name previous firing up the call
  *
  * @param string $name
  *
  * @return mixed|void
  */
 public function __get($name)
 {
     if (ArrayHelper::keyExists($name, $this->getInstalledPlugins())) {
         return $this->getPlugin($name);
     }
     return parent::__get($name);
 }
開發者ID:bariew,項目名稱:yii2-google-maps-library,代碼行數:14,代碼來源:PluginManager.php

示例4: __get

 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     if (array_key_exists($name, $this->_color)) {
         return $this->_color[$name];
     }
     return parent::__get($name);
 }
開發者ID:chenyongze,項目名稱:yii2-qrcode-helper,代碼行數:10,代碼來源:RgbColor.php

示例5: __get

 public function __get($name)
 {
     if (isset($this->_user[$name])) {
         return $this->_user[$name];
     }
     return parent::__get($name);
 }
開發者ID:weiyiyi,項目名稱:base,代碼行數:7,代碼來源:UserIdentity.php

示例6: __get

 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     $config = $this->getFieldsConfig();
     if (isset($config[$name]) and is_array($config[$name])) {
         return $this->getField($name);
     }
     return parent::__get($name);
 }
開發者ID:frostiks25,項目名稱:rzwebsys7,代碼行數:11,代碼來源:MetaFields.php

示例7: __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:fogunkoya,項目名稱:yii2-eauth,代碼行數:16,代碼來源:ServiceBase.php

示例8: __get

 /**
  * Returns the value of a property.
  *
  * @param string $name the property name
  * @return mixed the property value
  * @throws UnknownPropertyException if the property is not defined
  */
 public function __get($name)
 {
     if (isset($this->_data[$name])) {
         return $this->_data[$name];
     } else {
         return parent::__get($name);
     }
 }
開發者ID:bitxseven,項目名稱:yii2-big,代碼行數:15,代碼來源:ManagerObject.php

示例9: __get

 /**
  * Returns the value of an object property.
  *
  * Do not call this method directly as it is a PHP magic method that
  * will be implicitly called when executing `$value = $object->property;`.
  * @param string $name the property name
  * @return mixed the property value
  * @throws UnknownPropertyException if the property is not defined
  * @throws InvalidCallException if the property is write-only
  * @see __set()
  */
 public function __get($name)
 {
     if (property_exists($this->instance, $name)) {
         return $this->instance->{$name};
     }
     return parent::__get($name);
     // TODO: Change the autogenerated stub
 }
開發者ID:TeoChoi,項目名稱:yii2-hashids,代碼行數:19,代碼來源:Transfer.php

示例10: __get

 /**
  *
  * @see \yii\base\Object::__get()
  * @param string $name
  * @return mixed
  * @throws WorkflowException
  */
 public function __get($name)
 {
     if ($this->canGetProperty($name)) {
         return parent::__get($name);
     } elseif ($this->hasMetadata($name)) {
         return $this->_metadata[$name];
     } else {
         throw new WorkflowException("No metadata found is the name '{$name}'");
     }
 }
開發者ID:fproject,項目名稱:workflowii,代碼行數:17,代碼來源:AbstractWorkflowItem.php

示例11: __get

 public function __get($name)
 {
     if ($this->_payload && isset($this->_payload[$name])) {
         return $this->_payload[$name];
     } else {
         if (isset($this->{$name})) {
             return parent::__get($name);
         } else {
             throw new \yii\base\Exception("The '" . $name . "' attribute " . "was not found in CrugeIdentity or in its Payload.");
         }
     }
 }
開發者ID:freesoftwarefactory,項目名稱:cruge,代碼行數:12,代碼來源:CrugeIdentity.php

示例12: __call

 /**
  * @param string $name
  * @param array $params
  * @return mixed
  * @throws \yii\base\UnknownPropertyException
  */
 public function __call($name, $params)
 {
     if (method_exists($this->model, $name)) {
         return call_user_func_array([$this->model, $name], $params);
     }
     foreach ($this->model->behaviors as $behavior) {
         if (method_exists($behavior, $name)) {
             return call_user_func_array([$this->model, $name], $params);
         }
     }
     return parent::__get($name);
 }
開發者ID:vetoni,項目名稱:toko,代碼行數:18,代碼來源:ApiObject.php

示例13: __get

 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     // getters go first
     $getter = 'get' . $name;
     if (method_exists($this, $getter)) {
         return $this->{$getter}();
     }
     return ArrayHelper::keyExists($name, $this->options) ? $this->options[$name] : parent::__get($name);
 }
開發者ID:denisiodb,項目名稱:yii2-google-maps-library,代碼行數:12,代碼來源:ObjectAbstract.php

示例14: __get

 /**
  * @param string $name
  * @return ParamsObject|mixed|null
  * @throws UnknownPropertyException
  */
 public function __get($name)
 {
     try {
         return parent::__get($name);
     } catch (UnknownPropertyException $e) {
         return $this->params($name);
     }
 }
開發者ID:ezsky,項目名稱:yii2-platform-core,代碼行數:13,代碼來源:ParamsManager.php

示例15: __get

 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     return parent::__get(Inflector::camelize($name));
 }
開發者ID:cookyii,項目名稱:base,代碼行數:7,代碼來源:AbstractHelper.php


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