本文整理汇总了PHP中CModel::__unset方法的典型用法代码示例。如果您正苦于以下问题:PHP CModel::__unset方法的具体用法?PHP CModel::__unset怎么用?PHP CModel::__unset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModel
的用法示例。
在下文中一共展示了CModel::__unset方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __unset
public function __unset($name)
{
if (in_array($name, $this->attributeNames())) {
unset($this->_attributes[$name]);
} else {
parent::__unset($name);
}
}
示例2: __unset
/**
* (non-PHPdoc)
* @see CComponent::__unset()
*/
public function __unset($name)
{
if (isset($this->_attributes[$name])) {
unset($this->_attributes[$name]);
} elseif (isset($this->_related[$name])) {
unset($this->_related[$name]);
} else {
parent::__unset($name);
}
}
示例3: __unset
public function __unset($name)
{
if (isset($this->getMetaData()->columns[$name])) {
unset($this->_attributes[$name]);
} elseif (isset($this->getMetaData()->relations[$name])) {
unset($this->_related[$name]);
} else {
parent::__unset($name);
}
}
示例4: __unset
/**
* Sets a component property to be null.
* This method overrides the parent implementation by clearing
* the specified attribute value.
* @param string $name the property name or the event name
*/
public function __unset($name)
{
if (isset($this->getMetaData()->properties[$name])) {
unset($this->_attributes[$name]);
} else {
parent::__unset($name);
}
}
示例5: __unset
/**
* Sets a component property to be null.
* This method overrides the parent implementation by clearing
* the specified attribute value.
* @param string $name the property name or the event name
*
* @return void
*/
public function __unset($name)
{
if ($this->getResourceSchema()->hasAttribute($name)) {
unset($this->_attributes[$name]);
} elseif (isset($this->_links[$name])) {
unset($this->_linked[$name]);
} else {
parent::__unset($name);
}
}
示例6: __unset
/**
* Sets a component property to be null.
* Do not call this method. This is a PHP magic method that we override
* to allow using unset() to set a component property to be null.
* @param string $name the property name or the event name
* @throws \CException if the property is read only.
* @return mixed
*/
public function __unset($name)
{
if (array_key_exists($name, $this->_attributes)) {
unset($this->_attributes[$name]);
} else {
parent::__unset($name);
}
}