本文整理汇总了PHP中yii\base\Model::__get方法的典型用法代码示例。如果您正苦于以下问题:PHP Model::__get方法的具体用法?PHP Model::__get怎么用?PHP Model::__get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\base\Model
的用法示例。
在下文中一共展示了Model::__get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __get
public function __get($name)
{
if (stripos($name, 'attr') === 0) {
return isset($this->attr[$name]) ? $this->attr[$name] : null;
}
return parent::__get($name);
}
示例2: __get
public function __get($name)
{
if (isset($this->_attributes[$name])) {
return $this->_attributes[$name];
}
return parent::__get($name);
}
示例3: __get
/**
* @param string $name
* @return mixed
* @throws \yii\base\UnknownPropertyException
*/
public function __get($name)
{
if (parent::hasProperty($name)) {
return parent::__get($name);
}
return $this->db->{$name};
}
示例4: __get
/**
* @inheritdoc
*/
public function __get($name)
{
if (isset($this->attrStorage[$name])) {
return $this->attrStorage[$name];
}
return parent::__get($name);
}
示例5: __get
/**
* @param string $name
* @return mixed
* @throws \yii\base\UnknownPropertyException
*/
public function __get($name)
{
if (array_key_exists($name, $this->apiData)) {
return ArrayHelper::getValue($this->apiData, $name);
}
return parent::__get($name);
}
示例6: __get
public function __get($name)
{
if (!isset($this->{$name})) {
return false;
}
parent::__get($name);
}
示例7: __get
/**
* This method is overridden to support accessing items like properties.
*
* @param string $name component or property name
*
* @return mixed item of found or the named property value
*/
public function __get($name)
{
if ($name && $this->canGetProperty($name)) {
return parent::__get($name);
} else {
return $this->getItem($name);
}
}
示例8: __get
/**
* @inheritdoc
*/
public function __get($name)
{
if (array_key_exists($name, $this->_attributes)) {
return $this->_attributes[$name];
} else {
return parent::__get($name);
}
}
示例9: __get
/**
* @param string $name
* @return mixed
* @throws \yii\base\UnknownPropertyException
*/
public function __get($name)
{
if (key_exists($name, $this->_attributes)) {
$result = $this->_attributes[$name];
} else {
$result = parent::__get($name);
}
return $result;
}
示例10: __get
/**
* @inheritdoc
*/
public function __get($name)
{
if (isset($this->attrStorage[$name])) {
return $this->attrStorage[$name];
}
if (in_array($name, $this->attributes())) {
return '';
}
return parent::__get($name);
}
示例11: __get
public function __get($name)
{
if (in_array($name, ['creditCard_number', 'creditCard_expirationDate', 'creditCard_cvv'])) {
if (!isset($this->_attributes[$name])) {
$this->_attributes[$name] = null;
}
return $this->_attributes[$name];
}
return parent::__get($name);
}
示例12: __get
/**
* @param string $name
* @return $this|mixed
* @throws \yii\base\UnknownPropertyException
*/
public function __get($name)
{
if (isset($this->_attributes[$name])) {
return $this->_attributes[$name];
}
$_name = explode('.', $name);
if (count($_name) == 2) {
return Settings::value($_name[0], $_name[1]);
}
return parent::__get($name);
}
示例13: __get
public function __get($name)
{
if (array_key_exists($name, array_flip($this->extraAttributes))) {
if (isset($this->extraAttributesData[$name])) {
return $this->extraAttributesData[$name];
} else {
return null;
}
}
return parent::__get($name);
}
示例14: __get
public function __get($name)
{
if (isset($this->models[$name])) {
return $this->models[$name];
}
foreach ($this->models as $model) {
if ($model->hasAttribute($name)) {
return $model->getAttribute($name);
}
}
return parent::__get($name);
}
示例15: __get
/**
* @brief 获取属性名称
*
* @return public function
* @retval
* @see
* @note
* @author 吕宝贵
* @date 2016/03/07 15:49:24
**/
public function __get($name)
{
if (isset($this->_attributes[$name]) || array_key_exists($name, $this->_attributes)) {
return $this->_attributes[$name];
} elseif ($this->hasAttribute($name)) {
return null;
} else {
if (isset($this->_related[$name]) || array_key_exists($name, $this->_related)) {
return $this->_related[$name];
}
$value = parent::__get($name);
return $value;
}
}