58 lines
1.4 KiB
PHP
58 lines
1.4 KiB
PHP
<?php
|
|
|
|
|
|
|
|
class EmployeeMapBuilder {
|
|
|
|
|
|
const CLASS_NAME = 'lib.model.map.EmployeeMapBuilder';
|
|
|
|
|
|
private $dbMap;
|
|
|
|
|
|
public function isBuilt()
|
|
{
|
|
return ($this->dbMap !== null);
|
|
}
|
|
|
|
|
|
public function getDatabaseMap()
|
|
{
|
|
return $this->dbMap;
|
|
}
|
|
|
|
|
|
public function doBuild()
|
|
{
|
|
$this->dbMap = Propel::getDatabaseMap('propel');
|
|
|
|
$tMap = $this->dbMap->addTable('Employee');
|
|
$tMap->setPhpName('Employee');
|
|
|
|
$tMap->setUseIdGenerator(true);
|
|
|
|
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
|
|
|
|
$tMap->addColumn('NAME', 'Name', 'string', CreoleTypes::VARCHAR, false, 100);
|
|
|
|
$tMap->addColumn('DEGREES', 'Degrees', 'string', CreoleTypes::VARCHAR, false, 255);
|
|
|
|
$tMap->addColumn('PHONE', 'Phone', 'string', CreoleTypes::VARCHAR, false, 25);
|
|
|
|
$tMap->addColumn('CELLPHONE', 'Cellphone', 'string', CreoleTypes::VARCHAR, false, 25);
|
|
|
|
$tMap->addColumn('EMAIL', 'Email', 'string', CreoleTypes::VARCHAR, false, 100);
|
|
|
|
$tMap->addColumn('PICTURE', 'Picture', 'string', CreoleTypes::VARCHAR, false, 100);
|
|
|
|
$tMap->addColumn('ACTIVE', 'Active', 'boolean', CreoleTypes::BOOLEAN, false, null);
|
|
|
|
$tMap->addForeignKey('POSITION', 'Position', 'int', CreoleTypes::INTEGER, 'LU_Employee_Position', 'ID', false, null);
|
|
|
|
$tMap->addColumn('SLUG', 'Slug', 'string', CreoleTypes::VARCHAR, false, 100);
|
|
|
|
$tMap->addColumn('SORT_ORDER', 'SortOrder', 'int', CreoleTypes::INTEGER, false, null);
|
|
|
|
}
|
|
}
|