[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/dao/ -> userpermission.class.php (source)

   1  <?php
   2  
   3      lt_include( PLOG_CLASS_PATH."class/database/dbobject.class.php" );
   4  
   5      /**
   6       * represents a permission from the database
   7       *
   8       * \ingroup DAO
   9       */         
  10      class UserPermission extends DbObject 
  11      {
  12  
  13          var $_userId;
  14          var $_blogId;
  15          var $_permId;
  16          var $_id;
  17          var $_perm;
  18          var $_user;
  19  
  20      	function UserPermission( $userId, $blogId, $permId, $id = -1 )
  21          {
  22              $this->DbObject();
  23              $this->_userId = $userId;
  24              $this->_blogId = $blogId;
  25              $this->_permId = $permId;
  26              $this->_id     = $id;
  27              $this->_perm   = null;
  28              $this->_user   = null;
  29              
  30              $this->_pk = "id";
  31              $this->_fields = Array (
  32                  "blog_id" => "getBlogId",
  33                  "user_id" => "getUserId",
  34                  "permission_id" => "getPermissionId" 
  35              );
  36          }
  37  
  38          function getId()
  39          {
  40              return $this->_id;
  41          }
  42          
  43  		function setId( $id )
  44          {
  45              $this->_id = $id;
  46          }
  47  
  48          function getBlogId()
  49          {
  50              return $this->_blogId;
  51          }
  52          
  53  		function setBlogId( $blogId )
  54          {
  55              $this->_blogId = $blogId;
  56          }
  57          
  58  		function getBlogInfo()
  59          {
  60              if( $this->_blog === null ) {
  61                  lt_include( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
  62                  $blogs = new Blogs();
  63                  $this->_blog = $blogs->getBlogInfo( $this->getBlogId());
  64              }
  65              
  66              return( $this->_blog );    
  67          }
  68  
  69          function getPermissionId()
  70          {
  71              return $this->_permId;
  72          }
  73          
  74  		function setPermission( $perm )
  75          {
  76              $this->_perm = $perm;
  77              $this->_permId = $perm->getId();            
  78          }
  79          
  80  		function getPermission()
  81          {
  82              if( $this->_perm === null ) {
  83                  lt_include( PLOG_CLASS_PATH."class/dao/permissions.class.php" );
  84                  $perms = new Permissions();    
  85                  $this->_perm = $perms->getPermission( $this->_permId );
  86              }
  87              
  88              return( $this->_perm );
  89          }
  90          
  91  		function getPermissionName()
  92          {
  93              $perm = $this->getPermission();
  94              return( $perm->getName());    
  95          }
  96          
  97  		function getPermissionDescription()
  98          {
  99              $perm = $this->getPermission();
 100              return( $perm->getDescription());                    
 101          }
 102  
 103          function getUserId()
 104          {
 105              return $this->_userId;
 106          }
 107          
 108  		function setUserId( $userId )
 109          {
 110              $this->_userId = $userId;
 111          }
 112          
 113  		function getUserInfo()
 114          {
 115              if( $this->_user === null ) {
 116                  lt_include( PLOG_CLASS_PATH."class/dao/users.class.php" );
 117                  $users = new Users();
 118                  $this->_user = $users->getUserInfoFromId( $this->getUserId());
 119              }
 120              
 121              return( $this->_user );                
 122          }
 123      }
 124  ?>


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics