本文整理汇总了PHP中yii\db\ActiveRecord::__get方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveRecord::__get方法的具体用法?PHP ActiveRecord::__get怎么用?PHP ActiveRecord::__get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\db\ActiveRecord
的用法示例。
在下文中一共展示了ActiveRecord::__get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getValue
/**
* @inheritDoc
*/
protected function _getValue(ActiveRecord $model)
{
if ($model instanceof ActiveRecord) {
/** @var ActiveRecord $model */
return $model->__get($this->attributeName);
}
}
示例2: __get
public function __get($name)
{
if (isset($this->_pivotAttributes[$name])) {
return $this->_pivotAttributes[$name];
}
return parent::__get($name);
}
示例3: __get
public function __get($name)
{
if ($name === 'history') {
return $this->getHistory();
}
return parent::__get($name);
}
示例4: __get
public function __get($name)
{
if ($name == 'display_type') {
return $this->getDisplayType();
} else {
return parent::__get($name);
}
}
示例5: __get
public function __get($name)
{
if (in_array($name, $this->jsonParams)) {
return $this->getJsonParams($name);
} else {
return parent::__get($name);
}
}
示例6: __get
/**
* Override __get of yii\db\ActiveRecord
*
* @param string $name the property name
* @return mixed
*/
public function __get($name)
{
if ($this->hasAttribute($name)) {
return parent::__get($name);
} else {
return $this->getMetaAttribute($name);
}
}
示例7: __get
/**
* @param string $field
*
* @return mixed|void
*/
public function __get($field)
{
if (in_array($field, $this->getMultiLangFields())) {
$language = \Yii::$app->language;
$field = $this->buildMultilangFieldName($field, $language);
}
return parent::__get($field);
}
示例8: __get
public function __get($name)
{
if (!in_array($name, $this->attributes()) && !empty($this->app->elements[$name]) && ($behavior = $this->getBehavior($this->app->elements[$name]->type)) !== null) {
return $behavior->getValue($name);
} else {
return parent::__get($name);
}
}
示例9: __get
/**
* @inheritdoc
*/
public function __get($name)
{
if ($this->_schema && isset($this->_schema[$name])) {
if (array_key_exists($name, $this->_values)) {
return $this->_values[$name];
} else {
return null;
}
}
return parent::__get($name);
}
示例10: __get
public function __get($name)
{
try {
return parent::__get($name);
} catch (UnknownPropertyException $e) {
if (isset($this->_transformers[$name])) {
return $this->_transformers[$name]->transformFrom();
}
return parent::__get(static::prop2col($name));
}
}
示例11: __get
public function __get($name)
{
if (in_array($name, $this->getDefaultFields())) {
return parent::__get($name);
}
if (in_array($name, $this->getSkipFields())) {
$rules = Json::decode($this->rules);
if (isset($rules[$name])) {
return $rules[$name];
}
}
return [];
}
示例12: __get
/**
* @return mixed
*/
public function __get($name)
{
// if the attribute is defined as a meta-attribute, fetch it
// otherwise let the parent class handle the request
if ($this->hasMetaAttribute($name)) {
return $this->getMeta($name);
} else {
if (($val = ArrayHelper::getValue($this, $name)) !== null) {
return $val;
} else {
return parent::__get($name);
}
}
}
示例13: issetAttribute
/**
* Returns if a model attribute is set.
*
* @param string $name attribute name, use dotted notation for structured attributes.
*
* @return bool true if the attribute is set
*/
public function issetAttribute($name)
{
try {
if (parent::__get($name) !== null) {
return true;
}
} catch (Exception $ignore) {
}
$path = explode('.', $name);
$ref =& $this->_dynamicAttributes;
foreach ($path as $key) {
if (!isset($ref[$key])) {
return false;
}
$ref =& $ref[$key];
}
return true;
}
示例14: __get
public function __get($key)
{
if ($key = $this->hasKey($key)) {
return parent::__get($key);
}
}
示例15: __get
/**
* @inheritdoc
*/
public function __get($name)
{
return $name === 'name' ? $this->name() : parent::__get($name);
}