dbMap !== null); } /** * Gets the databasemap this map builder built. * * @return the databasemap */ public function getDatabaseMap() { return $this->dbMap; } /** * The doBuild() method builds the DatabaseMap * * @return void * @throws PropelException */ public function doBuild() { $this->dbMap = Propel::getDatabaseMap('bookstore'); $tMap = $this->dbMap->addTable('book'); $tMap->setPhpName('Book'); $tMap->setUseIdGenerator(true); $tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true); $tMap->addColumn('TITLE', 'Title', 'string', CreoleTypes::VARCHAR, true, 255); $tMap->addColumn('ISBN', 'ISBN', 'string', CreoleTypes::VARCHAR, true, 24); $tMap->addForeignKey('PUBLISHER_ID', 'PublisherId', 'int', CreoleTypes::INTEGER, 'publisher', 'ID', false); $tMap->addForeignKey('AUTHOR_ID', 'AuthorId', 'int', CreoleTypes::INTEGER, 'author', 'ID', false); $tMap->addValidator('TITLE', 'unique', 'propel.validator.UniqueValidator', '', 'Book title already in database.'); $tMap->addValidator('TITLE', 'minLength', 'propel.validator.MinLengthValidator', '10', 'Book title must be more than 10 characters long.'); $tMap->addValidator('TITLE', 'maxLength', 'propel.validator.MaxLengthValidator', '255', 'Book title must not be longer than 255 characters.'); $tMap->addValidator('ISBN', 'notMatch', 'propel.validator.NotMatchValidator', '/[^\d-]+/', 'The ISBN contains invalid characters.'); } // doBuild() } // BookMapBuilder