当前位置: 首页>>代码示例>>PHP>>正文


PHP ElggEntity::__set方法代码示例

本文整理汇总了PHP中ElggEntity::__set方法的典型用法代码示例。如果您正苦于以下问题:PHP ElggEntity::__set方法的具体用法?PHP ElggEntity::__set怎么用?PHP ElggEntity::__set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ElggEntity的用法示例。


在下文中一共展示了ElggEntity::__set方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __set

 /**
  * {@inheritdoc}
  */
 public function __set($name, $value)
 {
     if (array_key_exists($name, $this->attributes)) {
         switch ($name) {
             case 'prev_last_action':
             case 'last_login':
             case 'prev_last_login':
                 if ($value !== null) {
                     $this->attributes[$name] = (int) $value;
                 } else {
                     $this->attributes[$name] = null;
                 }
                 break;
             default:
                 parent::__set($name, $value);
                 break;
         }
     } else {
         parent::__set($name, $value);
     }
 }
开发者ID:sephiroth88,项目名称:Elgg,代码行数:24,代码来源:ElggUser.php

示例2: __set

 /**
  * {@inheritdoc}
  */
 public function __set($name, $value)
 {
     if (!array_key_exists($name, $this->attributes)) {
         parent::__set($name, $value);
         return;
     }
     switch ($name) {
         case 'prev_last_action':
         case 'last_login':
         case 'prev_last_login':
             if ($value !== null) {
                 $this->attributes[$name] = (int) $value;
             } else {
                 $this->attributes[$name] = null;
             }
             break;
         case 'salt':
         case 'password':
             elgg_deprecated_notice("Setting salt/password directly is deprecated. Use ElggUser::setPassword().", "1.10");
             $this->attributes[$name] = $value;
             // this is emptied so that the user is not left with two usable hashes
             $this->attributes['password_hash'] = '';
             break;
             // setting this not supported
         // setting this not supported
         case 'password_hash':
             _elgg_services()->logger->error("password_hash is now an attribute of ElggUser and cannot be set.");
             return;
             break;
         default:
             parent::__set($name, $value);
             break;
     }
 }
开发者ID:cyrixhero,项目名称:Elgg,代码行数:37,代码来源:ElggUser.php

示例3: __set

 /**
  * Need to catch attempts to make a user an admin.  Remove for 1.9
  *
  * @param string $name  Name
  * @param mixed  $value Value
  *
  * @return bool
  */
 public function __set($name, $value)
 {
     if ($name == 'admin' || $name == 'siteadmin') {
         elgg_deprecated_notice('The admin/siteadmin metadata are not longer used.  Use ElggUser->makeAdmin() and ElggUser->removeAdmin().', 1.7);
         if ($value == 'yes' || $value == '1') {
             $this->makeAdmin();
         } else {
             $this->removeAdmin();
         }
     }
     return parent::__set($name, $value);
 }
开发者ID:duanhv,项目名称:mdg-social,代码行数:20,代码来源:ElggUser.php

示例4: __set

 /**
  * {@inheritdoc}
  */
 public function __set($name, $value)
 {
     if (!array_key_exists($name, $this->attributes)) {
         parent::__set($name, $value);
         return;
     }
     switch ($name) {
         case 'prev_last_action':
         case 'last_login':
         case 'prev_last_login':
             if ($value !== null) {
                 $this->attributes[$name] = (int) $value;
             } else {
                 $this->attributes[$name] = null;
             }
             break;
         case 'salt':
         case 'password':
             _elgg_services()->logger->error("User entities no longer contain salt/password");
             break;
             // setting this not supported
         // setting this not supported
         case 'password_hash':
             _elgg_services()->logger->error("password_hash is a readonly attribute.");
             break;
         default:
             parent::__set($name, $value);
             break;
     }
 }
开发者ID:elgg,项目名称:elgg,代码行数:33,代码来源:ElggUser.php


注:本文中的ElggEntity::__set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。