本文整理汇总了PHP中yii\base\Behavior::__set方法的典型用法代码示例。如果您正苦于以下问题:PHP Behavior::__set方法的具体用法?PHP Behavior::__set怎么用?PHP Behavior::__set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\base\Behavior
的用法示例。
在下文中一共展示了Behavior::__set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __set
public function __set($name, $value)
{
if ($this->fileInputName == $name) {
return $this->_file = $value;
}
return parent::__set($name, $value);
}
示例2: __set
public function __set($name, $value)
{
if ($this->checkName($name)) {
$this->setAttributes($value);
} else {
parent::__set($name, $value);
}
}
示例3: __set
/**
* @inheritdoc
*/
public function __set($name, $value)
{
try {
parent::__set($name, $value);
} catch (\Exception $e) {
$this->setAttribute($name, $value);
}
}
示例4: __set
/**
*
* @param type $name
* @param type $value
* @return type
*/
public function __set($name, $value)
{
if ($this->hasAttr($name)) {
return $this->setAttr($name, $value);
} else {
parent::__set($name, $value);
}
}
示例5: __set
/**
* Make [[$translationAttributes]] writable
* @param string $name
* @param mixed $value
*/
public function __set($name, $value)
{
if (in_array($name, $this->translationAttributes)) {
$this->getTranslation()->{$name} = $value;
} else {
parent::__set($name, $value);
}
}
示例6: __set
public function __set($name, $value)
{
if ($name == $this->propertyName) {
$this->setRelationIds($value);
} else {
parent::__set($name, $value);
}
}
示例7: __set
public function __set($name, $value)
{
if ($this->hasLocalValue($name)) {
$this->setLocalValue($name, $value);
} else {
parent::__set($name, $value);
}
}
示例8: __set
public function __set($name, $value)
{
if ($this->_relation->canGetProperty($name)) {
$this->_relation->{$name} = $value;
} else {
parent::__set($name, $value);
}
}
示例9: __set
public function __set($name, $value)
{
if ($this->hasAttribute($name)) {
$this->setAttribute($name, $value);
return;
}
parent::__set($name, $value);
}
示例10: __set
/**
* @inheritdoc
*/
public function __set($name, $value)
{
if (isset($this->attributes[$name])) {
$this->owner->{$this->attributes[$name]} = $this->convertToPhysical($value, $name);
} else {
parent::__set($name, $value);
}
}
示例11: __set
/**
* @param string $name
* @param mixed $value
* @throws \yii\base\UnknownPropertyException
*/
public function __set($name, $value)
{
if ($this->checkAttribute($name)) {
$this->voteAttributes[$name] = !is_null($value) ? (int) $value : null;
} else {
parent::__set($name, $value);
}
}
示例12: __set
public function __set($name, $value)
{
$rels = array_flip($this->directoryAttributes);
if (isset($rels[$name])) {
$this->setDirectory($rels[$name], $value);
} else {
parent::__set($name, $value);
}
}
示例13: __set
/**
* Make [[$attributes]] writable
* @inheritdoc
*/
public function __set($param, $value)
{
if (isset($this->attributes[$param])) {
//$this->owner->__set($this->attributes[$param], $this->convertToStoredFormat($value));
$this->owner->{$this->attributes[$param]} = $this->convertToStoredFormat($value);
} else {
parent::__set($param, $value);
}
}
示例14: __set
/**
* @inheritdoc
*/
public function __set($name, $value)
{
if (stripos($name, 'client') === 0) {
if (strcasecmp($name, 'clientId') == 0) {
throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::' . $name);
}
$this->setClientProperty(strtolower($name), $value);
} else {
parent::__set($name, $value);
}
}
示例15: __set
/**
* Make [[$translationAttributes]] writable
*/
public function __set($name, $value)
{
if (in_array($name, $this->translationAttributes)) {
if (is_array($value) and isset($value['translations'])) {
foreach ($value['translations'] as $language => $translatedValue) {
$this->getTranslation($language)->{$name} = $translatedValue;
}
} else {
$this->getTranslation()->{$name} = $value;
}
} else {
parent::__set($name, $value);
}
}