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; }
public function generateBaseModelClass(DeclareSchema $schema) { $cTemplate = BaseModelClassFactory::create($schema, $this->getBaseModelClass()); return $this->updateClassFile($cTemplate, $schema, true); }
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; }