本文整理汇总了PHP中Base::__set方法的典型用法代码示例。如果您正苦于以下问题:PHP Base::__set方法的具体用法?PHP Base::__set怎么用?PHP Base::__set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base
的用法示例。
在下文中一共展示了Base::__set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __set
public function __set($name, $value)
{
global $zbp;
switch ($name) {
case 'Category':
case 'Author':
case 'TypeName':
case 'Url':
case 'Tags':
case 'TagsName':
case 'TagsCount':
case 'CommentPostUrl':
case 'Prev':
case 'Next':
return null;
break;
case 'Template':
if ($value == $zbp->option['ZC_POST_DEFAULT_TEMPLATE']) {
$value = '';
}
return $this->Data[$name] = $value;
break;
default:
parent::__set($name, $value);
break;
}
}
示例2: __set
/**
* @param $name
* @param $value
* @return null|string
*/
public function __set($name, $value)
{
global $zbp;
if ($name == 'Url') {
return null;
}
if ($name == 'Symbol') {
return null;
}
if ($name == 'Level') {
return null;
}
if ($name == 'SymbolName') {
return null;
}
if ($name == 'Parent') {
return null;
}
if ($name == 'Template') {
if ($value == $zbp->option['ZC_INDEX_DEFAULT_TEMPLATE']) {
$value = '';
}
return $this->data[$name] = $value;
}
if ($name == 'LogTemplate') {
if ($value == $zbp->option['ZC_POST_DEFAULT_TEMPLATE']) {
$value = '';
}
return $this->data[$name] = $value;
}
parent::__set($name, $value);
}
示例3: __set
/**
* 自定义参数及值
* @param $name
* @param $value
* @return null|string
*/
public function __set($name, $value)
{
global $zbp;
if ($name == 'Url') {
$u = new UrlRule($zbp->option['ZC_AUTHOR_REGEX']);
$u->Rules['{%id%}'] = $this->ID;
$u->Rules['{%alias%}'] = $this->Alias == '' ? urlencode($this->Name) : $this->Alias;
return $u->Make();
}
if ($name == 'Avatar') {
return null;
}
if ($name == 'LevelName') {
return null;
}
if ($name == 'EmailMD5') {
return null;
}
if ($name == 'StaticName') {
return null;
}
if ($name == 'Template') {
if ($value == $zbp->option['ZC_INDEX_DEFAULT_TEMPLATE']) {
$value = '';
}
return $this->data[$name] = $value;
}
parent::__set($name, $value);
}
示例4: message
function __set($key, $value)
{
if (isset($this->filters[$key]) and !$this->is_filter[$this->filters[$key]]($value)) {
message(App::$lang_common['Bad request'] . ' Passed parameter is invalid');
}
parent::__set($key, $value);
}
示例5: __set
/**
* 自定义参数及值
* @param $name
* @param $value
* @return null|string
*/
public function __set($name, $value)
{
global $zbp;
if ($name == 'Url') {
return null;
}
if ($name == 'Avatar') {
return null;
}
if ($name == 'LevelName') {
return null;
}
if ($name == 'EmailMD5') {
return null;
}
if ($name == 'StaticName') {
return null;
}
if ($name == 'Template') {
if ($value == $zbp->option['ZC_INDEX_DEFAULT_TEMPLATE']) {
$value = '';
}
return $this->data[$name] = $value;
}
if ($name == 'PassWord_MD5Path') {
return null;
}
if ($name == 'IsGod') {
return null;
}
parent::__set($name, $value);
}
示例6: __set
public function __set($name, $value)
{
global $zbp;
if ($name == 'SourceType') {
return null;
}
parent::__set($name, $value);
}
示例7: __set
/**
* 设置参数值
* @param string $name
* @param mixed $value
* @return null
*/
public function __set($name, $value)
{
global $zbp;
if ($name == 'SourceType') {
return null;
}
if ($name == 'NoRefresh') {
if ((bool) $value) {
$this->Metas->norefresh = (bool) $value;
} else {
$this->Metas->Del('norefresh');
}
return null;
}
parent::__set($name, $value);
}
示例8: switch
/**
* Sets the variables of the object and updates the database if nescessary.
* Unrecognized properties are forwarded to it's parent
* @param string $property The property which to change
* @param mixed $value The new value of the property
* @see solidbase/lib/Base#__set($property, $value)
*/
function __set($property, $value)
{
switch ($property) {
case 'place':
$this->move($value);
break;
case 'parent':
if (@$Controller->alias('menu_editor')->mayI(EDIT)) {
$this->move('last', $value);
}
break;
default:
parent::__set($property, $value);
break;
}
}
示例9: __set
public function __set($name, $value)
{
global $zbp;
if ($name == 'Author') {
return null;
}
if ($name == 'Comments') {
return null;
}
if ($name == 'Level') {
return null;
}
if ($name == 'Post') {
return null;
}
parent::__set($name, $value);
}
示例10: __set
/**
* 设置参数值
* @param string $name
* @param mixed $value
* @return null
*/
public function __set($name, $value)
{
global $zbp;
if ($name == 'SourceType') {
return null;
}
if ($name == 'NoRefresh') {
$n = 'module_norefresh_' . $this->FileName;
if ($value == true) {
$zbp->cache->{$n} = true;
$zbp->SaveCache();
} else {
if ($zbp->cache->HasKey($n) == true) {
$zbp->cache->Del($n);
$zbp->SaveCache();
}
}
return null;
}
parent::__set($name, $value);
}
示例11: __set
/**
* @param $name
* @param $value
* @return null
*/
public function __set($name, $value)
{
global $zbp;
if ($name == 'Url') {
return null;
}
if ($name == 'Dir') {
return null;
}
if ($name == 'FullFile') {
return null;
}
if ($name == 'Author') {
return null;
}
parent::__set($name, $value);
}
示例12: __set
/**
* 自定义参数及值
* @param $name
* @param $value
* @return null|string
*/
public function __set($name, $value)
{
global $zbp;
if ($name == 'Url') {
foreach ($GLOBALS['hooks']['Filter_Plugin_Member_Url'] as $fpname => &$fpsignal) {
$fpsignal = PLUGIN_EXITSIGNAL_NONE;
$fpreturn = $fpname($this);
if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
return $fpreturn;
}
}
$u = new UrlRule($zbp->option['ZC_AUTHOR_REGEX']);
$u->Rules['{%id%}'] = $this->ID;
$u->Rules['{%alias%}'] = $this->Alias == '' ? rawurlencode($this->Name) : $this->Alias;
return $u->Make();
}
if ($name == 'Avatar') {
return null;
}
if ($name == 'LevelName') {
return null;
}
if ($name == 'EmailMD5') {
return null;
}
if ($name == 'StaticName') {
return null;
}
if ($name == 'Template') {
if ($value == $zbp->option['ZC_INDEX_DEFAULT_TEMPLATE']) {
$value = '';
}
return $this->data[$name] = $value;
}
if ($name == 'PassWord_MD5Path') {
return null;
}
if ($name == 'IsGod') {
return null;
}
parent::__set($name, $value);
}
示例13: __set
/**
* @param $name
* @param $value
* @return null|string
*/
public function __set($name, $value)
{
global $zbp;
switch ($name) {
case 'Category':
case 'Author':
case 'TypeName':
case 'Url':
case 'Tags':
case 'TagsName':
case 'TagsCount':
case 'CommentPostUrl':
case 'Prev':
case 'Next':
case 'RelatedList':
return null;
break;
case 'Template':
if ($value == $zbp->GetPostType_Template($this->Type)) {
$value = '';
}
return $this->data[$name] = $value;
break;
case 'TopType':
if ($value == 'global' || $value == 'category') {
$this->Metas->toptype = $value;
} elseif ($value == '' || $value == null) {
$this->Metas->Del('toptype');
} else {
$this->Metas->toptype = 'index';
}
return null;
break;
default:
parent::__set($name, $value);
break;
}
}
示例14: __set
/**
* Sets the variable to the given value and updates the database, if allowed. If the property is unknown, the call is passed to parent class.
* @access public
* @param string $property The property to edit
* @param mixed $value The value to set the property with
*/
function __set($property, $value)
{
global $DB, $USER;
$ipn = '_' . $property;
switch ($property) {
case 'password':
if ($this->password == 'LDAP') {
break;
}
if (empty($value)) {
return false;
}
$value = pwdEncode($value);
//NOTE: No break here
//NOTE: No break here
case 'username':
if (empty($value)) {
return false;
}
Base::__set('Name', $value);
case 'passwordhash':
// passwordhash bypasses pwdEncode and sets the raw password hash.
if (empty($value)) {
return false;
}
if ($property == 'passwordhash') {
$ipn = '_password';
$property = 'password';
}
if ($this->{$ipn} === $value) {
break;
}
$this->{$ipn} = $value;
$DB->users->{$this->ID} = array($property => $value);
break;
case 'userinfo':
if (!is_array($value)) {
return false;
}
foreach ($value as $prop => $val) {
$DB->userinfo->update(array('val' => $val), array('prop' => $prop, 'id' => $this->ID), true);
}
$this->_userinfo = array_merge($this->_userinfo, $value);
break;
default:
parent::__set($property, $value);
}
}
示例15: array
function __set($property, $value)
{
global $DB;
$ipn = '_' . $property;
if (in_array($property, array('page', 'type', 'row', 'place', 'content'))) {
$this->{$ipn} = $value;
$DB->pagelayout->{$this->ID} = array($property => $value);
} elseif ($property == 'module') {
$this->{$ipn} = $value;
$DB->pagelayout->{$this->ID} = array($property => $value);
$this->reset();
} elseif ($property == 'size') {
if ($this->_row === false) {
$this->ld();
}
$size = $DB->pagelayout->getCell(array('id!' => $this->ID, 'pid' => $this->page, 'row' => $this->row), "SUM(`size`)");
if ($size + $value > $this->maxcols) {
Flash::create('Wrong size! The box won\'t fit');
return false;
}
$this->{$ipn} = $value;
$DB->pagelayout->{$this->ID} = array($property => $value);
} else {
parent::__set($property, $value);
}
}