예제 #1
0
 /**
  * @return Prototype
  */
 public static function prototype()
 {
     $implementer = get_called_class();
     if (PrototypeRegistry::hasPrototype($implementer)) {
         return PrototypeRegistry::getPrototype($implementer);
     }
     return new Prototype(get_called_class(), static::buildDescription(), array());
 }
예제 #2
0
 /**
  * Provides access to a prototype of the Prooph\ProcessingType\Type (empty Object, with a Description and PrototypeProperties)
  *
  * @return Prototype
  */
 public static function prototype()
 {
     $implementer = get_called_class();
     if (PrototypeRegistry::hasPrototype($implementer)) {
         return PrototypeRegistry::getPrototype($implementer);
     }
     $propertyPrototypes = static::getPropertyPrototypes();
     $propertyMap = array();
     foreach ($propertyPrototypes as $propertyName => $propertyPrototype) {
         $propertyMap[$propertyName] = new PrototypeProperty($propertyName, $propertyPrototype);
     }
     return new Prototype($implementer, static::buildDescription(), $propertyMap);
 }