Ejemplo n.º 1
0
 public function generateSchema(SchemaInterface $schema, $overwrite = false)
 {
     $classMap = array();
     $cTemplates = array();
     $cTemplates[] = BaseModelClassFactory::create($schema, $this->getBaseModelClass());
     $cTemplates[] = SchemaProxyClassFactory::create($schema);
     $cTemplates[] = BaseCollectionClassFactory::create($schema, $this->getBaseCollectionClass());
     foreach ($cTemplates as $cTemplate) {
         if ($result = $this->updateClassFile($cTemplate, $schema, $overwrite)) {
             list($className, $classFile) = $result;
             $classMap[$className] = $classFile;
         }
     }
     if ($result = $this->generateCollectionClass($schema, false)) {
         list($className, $classFile) = $result;
         $classMap[$className] = $classFile;
     }
     if ($result = $this->generateModelClass($schema, false)) {
         list($className, $classFile) = $result;
         $classMap[$className] = $classFile;
     }
     return $classMap;
 }
Ejemplo n.º 2
0
 public function generateSchemaProxyClass(DeclareSchema $schema)
 {
     $cTemplate = SchemaProxyClassFactory::create($schema);
     return $this->updateClassFile($cTemplate, $schema, true);
 }
Ejemplo n.º 3
0
 public function generateSchemaFiles(SchemaInterface $schema)
 {
     $classMap = array();
     $cTemplates = array();
     // always update schema proxy and base classes
     $cTemplates[] = SchemaProxyClassFactory::create($schema);
     $cTemplates[] = BaseModelClassFactory::create($schema, $this->getBaseModelClass());
     $cTemplates[] = BaseCollectionClassFactory::create($schema, $this->getBaseCollectionClass());
     foreach ($cTemplates as $cTemplate) {
         if ($result = $this->updateClassFile($cTemplate, $schema, true)) {
             list($className, $classFile) = $result;
             $classMap[$className] = $classFile;
         }
     }
     if ($result = $this->generateCollectionClass($schema)) {
         list($className, $classFile) = $result;
         $classMap[$className] = $classFile;
     }
     if ($result = $this->generateModelClass($schema)) {
         list($className, $classFile) = $result;
         $classMap[$className] = $classFile;
     }
     return $classMap;
 }