Example #1
0
 /**
  *  Install.
  *
  *  This static method iterate over the classes lists,
  *  and execute the setup() method on every ActiveMongo
  *  subclass. You should do this just once.
  *
  */
 public static final function install()
 {
     $classes = array_reverse(get_declared_classes());
     foreach ($classes as $class) {
         $r = new ReflectionClass($class);
         if ($r->IsAbstract()) {
             continue;
         }
         if ($class == __CLASS__) {
             break;
         }
         if (is_subclass_of($class, __CLASS__)) {
             $obj = new $class();
             $obj->setup();
         }
     }
 }