/**
  * Creates instance of target class
  * 
  * @param  string $type Class ID
  * @param  array  $args Class arguments
  * @return object       Class instance
  */
 public static function create($type, array $args = array())
 {
     // Create object
     $obj = parent::create($type, $args);
     // Track object if trackable
     if ($obj instanceof TrackableObjectAbstract) {
         ObjectTracker::getInstance()->track($obj);
     }
     return $obj;
 }
Exemple #2
0
 /**
  * Used to get a previously instantiated trackable object 
  * 
  * @param  string $type Type of the target object
  * @param  string $id   ID of the target object
  * @return object       Target bject
  */
 public static function getTrackedObject($type, $id)
 {
     return ObjectTracker::getInstance()->get($type, $id);
 }