[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/demos/blog/protected/Common/ -> BlogUser.php (source)

   1  <?php
   2  /**
   3   * BlogUser class file
   4   *
   5   * @author Qiang Xue <qiang.xue@gmail.com>
   6   * @link http://www.pradosoft.com/
   7   * @copyright Copyright &copy; 2006 PradoSoft
   8   * @license http://www.pradosoft.com/license/
   9   * @version $Id: BlogUser.php 1397 2006-09-07 07:55:53Z wei $
  10   */
  11  
  12  Prado::using('System.Security.TUser');
  13  
  14  /**
  15   * BlogUser class
  16   *
  17   * @author Qiang Xue <qiang.xue@gmail.com>
  18   * @link http://www.pradosoft.com/
  19   * @copyright Copyright &copy; 2006 PradoSoft
  20   * @license http://www.pradosoft.com/license/
  21   */
  22  class BlogUser extends TUser
  23  {
  24      private $_id;
  25  
  26  	public function getID()
  27      {
  28          return $this->_id;
  29      }
  30  
  31  	public function setID($value)
  32      {
  33          $this->_id=$value;
  34      }
  35  
  36  	public function getIsAdmin()
  37      {
  38          return $this->isInRole('admin');
  39      }
  40  
  41  	public function saveToString()
  42      {
  43          $a=array($this->_id,parent::saveToString());
  44          return serialize($a);
  45      }
  46  
  47  	public function loadFromString($data)
  48      {
  49          if(!empty($data))
  50          {
  51              list($id,$str)=unserialize($data);
  52              $this->_id=$id;
  53              return parent::loadFromString($str);
  54          }
  55          else
  56              return $this;
  57      }
  58  }
  59  
  60  ?>


Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7