[ 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/object/ -> object.class.php (source)

   1  <?php
   2  
   3      if(PHP_VERSION < 5)
   4          lt_include( PLOG_CLASS_PATH."class/object/exception.class.php" );
   5  
   6      lt_include( PLOG_CLASS_PATH."class/logger/loggermanager.class.php" );
   7      
   8      /**
   9       * \ingroup Core
  10       * 
  11       * <p><b>NOTE:</b> As of LifeType 1.1, this class is deprecated and all other classes in
  12       * LifeType do not longer extend this class. This dependency was removed due to performance
  13       * and memory usage.</p>
  14       * <p>If you have any custom code that is still extending this class, please make the necessary
  15       * changes to remove the dependency as this class will most likely be removed in future versions
  16       * of LifeType.</p>
  17       *
  18       * @deprecated
  19       */
  20      class Object 
  21      {
  22  
  23          var $_objId;
  24          var $log;
  25  
  26          /**
  27           * Constructor
  28           */
  29  		function Object()
  30          {
  31              // initialize logging -- enable this only for debugging purposes
  32              $this->log =& LoggerManager::getLogger( "default" );
  33  
  34              if( DEBUG_ENABLED )
  35                  $this->debug =& LoggerManager::getLogger( "debug" );
  36          }
  37  
  38          function __getObjectId()
  39          {
  40              return $this->_objId;
  41          }
  42  
  43          /**
  44           * Returns a string with a representation of the class
  45           * @return The string representing the object
  46           */
  47  		function toString()
  48          {
  49              // returns the name of the class
  50              $ret_str = get_class( $this )." ".$this->_dumpVars();
  51  
  52              return $ret_str;
  53          }
  54  
  55  		function _dumpVars()
  56          {
  57              $vars = get_object_vars( $this );
  58  
  59              $keys = array_keys( $vars );
  60  
  61              $res = "[";
  62  
  63              foreach( $keys as $key )
  64                  $res .= " ".$key."=".$vars[$key];
  65  
  66              $res .= " ]";
  67  
  68              return $res;
  69          }
  70  
  71          /**
  72           * Returns the name of the class
  73           * @return String with the name of the class
  74           */
  75  		function className()
  76          {
  77              return get_class( $this );
  78          }
  79  
  80          /**
  81           * Returns the name of the parent class
  82           * @return String containing the name of the parent class
  83           */
  84  		function getParentClass()
  85          {
  86              return( get_parent_class( $this ));
  87          }
  88  
  89          /**
  90           * Returns true if the current class is a subclass of the given
  91           * class
  92           * @param $object The object.
  93           * @return True if the object is a subclass of the given object or false otherwise.
  94           */
  95  		function isSubclass( $object )
  96          {
  97              return is_subclass_of( $this, $object->className());
  98          }
  99  
 100          /**
 101           * Returns an array containing the methods available in this class
 102           * @return Array containing all the methods available in the object.
 103           */
 104  		function getMethods()
 105          {
 106              return get_class_methods( $this );
 107          }
 108  
 109          /**
 110           * Returns true if the class is of the given type.
 111           *
 112           * @param object Object
 113           * @return Returns true if they are of the same type or false otherwise.
 114           */
 115  		function typeOf( $object )
 116          {
 117              return is_a( $this, $object->className());
 118          }
 119      }
 120  ?>


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