protected function installXml($schemaProc) { $modelDir = $this->projectRoot . Meshing_Utils::getPaths()->getPathModelsNodes(); // Create task, configure, then run $task = new Meshing_Propel_ClassBuilder(); $task->setPropelConnection(); $task->addSchemas($this->schemaDir, $schemaProc); $task->setOutputDir($modelDir); $task->run(); echo "Schemas: " . $this->schemaDir . "\n"; echo "Output: " . $modelDir . "\n"; }
/** * Generates the system model * * @todo Move the paths to a build.properties file * * @param boolean $verbose */ protected function buildModel($verbose) { // Set db type, schema and output folder here $schemaDir = $this->projectRoot . Meshing_Utils::getPaths()->getPathDbConfig(); $schemas = Meshing_Utils::getPaths()->getLeafStandardSchema(); $outputDir = $this->projectRoot . Meshing_Utils::getPaths()->getPathModelsSystem(); // Create task, configure, then run $task = new Meshing_Propel_ClassBuilder(); $task->setPropelConnection(); $task->addSchemas($schemaDir, $schemas); $task->setOutputDir($outputDir); $task->run(); if ($verbose) { echo "done\n"; echo "Schemas: " . $schemaDir . "\n"; echo "Output: " . $outputDir . "\n"; } }
/** * Tests to build model classes, and optionally to test that build * * @param string $prefix * @param boolean $runTests */ protected function _testClassBuilder($prefix = null, $runTests = true) { $task = new Meshing_Propel_ClassBuilder(); $task->setPropelConnection(Meshing_Utils::CONN_NODE_TEST_1); $task->addSchemas($this->outputSchemaDir, $this->paths->getLeafStandardSchema()); $task->setOutputDir($this->modelDir); $task->run(); // Find these classes if ($runTests) { $package = $this->getPackage(); foreach ($this->expectedClasses() as $class) { foreach (array('', 'Peer', 'Query') as $classSuffix) { $this->assertTrue($this->classExists($class . $classSuffix, $package, $prefix), 'Checking generated class `' . $class . $classSuffix . '` exists'); } } } }