Example #1
0
 /**
  * Since the domain class is decoupled by the its key we must retrieve
  * the domain class form the domain registry that holds the mapping. Once
  * we have the class use the root domain namespace 
  *
  * @param	string	$key	key used to map the domain namespace
  * @return	mixed
  */
 public function createDomainObject($key)
 {
     $domainClass = KernelRegistry::getDomainClass($key);
     if (false === $domainClass) {
         return false;
     }
     try {
         return new $domainClass();
     } catch (Exception $e) {
         $err = "object not found for ({$key}) at ({$domainClass})";
         throw new RunTimeException($err, 0, $e);
     }
 }