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('author'); $tMap->setPhpName('Author'); $tMap->setUseIdGenerator(true); $tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true); $tMap->addColumn('FIRST_NAME', 'FirstName', 'string', CreoleTypes::VARCHAR, true, 128); $tMap->addColumn('LAST_NAME', 'LastName', 'string', CreoleTypes::VARCHAR, true, 128); $tMap->addColumn('EMAIL', 'Email', 'string', CreoleTypes::VARCHAR, false, 128); $tMap->addColumn('AGE', 'Age', 'int', CreoleTypes::INTEGER, false, null); $tMap->addValidator('LAST_NAME', 'required', 'propel.validator.RequiredValidator', '', 'The last name field is required.'); $tMap->addValidator('EMAIL', 'match', 'propel.validator.MatchValidator', '/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/', 'Please enter a valid email address.'); $tMap->addValidator('AGE', 'minValue', 'propel.validator.MinValueValidator', '0', 'Please enter a positive number.'); $tMap->addValidator('AGE', 'maxValue', 'propel.validator.MaxValueValidator', '100', 'Impressive age! Just kidding, hm?'); } // doBuild() } // AuthorMapBuilder