protected function writeRecords($tableNames) { $schema = new MeshingSchema(); $schema->setName($this->opts->name); $schema->setInstalledAt(time()); $schema->save(); foreach ($tableNames as $tableName) { $schemaTable = new MeshingSchemaTable(); $schemaTable->setMeshingSchema($schema); $schemaTable->setName($tableName); $schemaTable->save(); } }
/** * Creates a new KnownNode for node models * * @param PropelPDO $con PDO connection object * @return TestModelKnownNode */ protected function createKnownNode(BaseObject $node, PropelPDO $con = null) { $this->initConnections(); // Look up schema, and create an empty one if required $schema = MeshingSchemaQuery::create()->findOneByName($this->package, $this->conSystem); if (!$schema) { $schema = new MeshingSchema(); $schema->setName($this->package); $schema->setInstalledAt(time()); $schema->save($this->conSystem); } /* @var $node TestModelKnownNode */ $node->setName('Us!'); $node->setFqdn('http://example.com/path'); $node->setSchemaId($schema->getId()); $node->save($con); return $node; }