private function _setBaseColumns() { $col = new base_install_Column('PK'); $col->setType(base_install_Column::INT)->setPrimary()->setAutoIncrement(); $this->addColumn($col); $col = new base_install_Column('LK'); $col->setType(base_install_Column::INT); $this->addColumn($col); $col = new base_install_Column('histtop'); $col->setType(base_install_Column::VARCHAR)->setLength(2)->setDefault('Y'); $this->addColumn($col); $col = new base_install_Column('editTime'); $col->setType(base_install_Column::DATETIME); $this->addColumn($col); $col = new base_install_Column('editor'); $col->setType(base_install_Column::INT); $this->addColumn($col); $col = new base_install_Column('firstEditTime'); $col->setType(base_install_Column::DATETIME); $this->addColumn($col); $col = new base_install_Column('firstEditor'); $col->setType(base_install_Column::INT); $this->addColumn($col); }
private function _setBaseColumns() { $col = new base_install_Column('PK'); $col->setType(base_install_Column::INT)->setPrimary()->setAutoIncrement(); $this->addColumn($col); $col = new base_install_Column('classLeft'); $col->setType(base_install_Column::VARCHAR)->setLength(400); $this->addColumn($col); $col = new base_install_Column('lkLeft'); $col->setType(base_install_Column::INT); $this->addColumn($col); $col = new base_install_Column('lkRight'); $col->setType(base_install_Column::INT); $this->addColumn($col); $col = new base_install_Column('classRight'); $col->setType(base_install_Column::VARCHAR)->setLength(400); $this->addColumn($col); }
$table = new base_install_table_BaseObject('employee'); $col = new base_install_Column('firstName'); $col->setType(base_install_Column::VARCHAR)->setLength(400); $table->addColumn($col); $col = new base_install_Column('lastName'); $col->setType(base_install_Column::VARCHAR)->setLength(400); $table->addColumn($col); $col = new base_install_Column('graduation'); $col->setType(base_install_Column::VARCHAR)->setLength(400); $table->addColumn($col); $col = new base_install_Column('position'); $col->setType(base_install_Column::VARCHAR)->setLength(400); $table->addColumn($col); $col = new base_install_Column('email'); $col->setType(base_install_Column::VARCHAR)->setLength(400); $table->addColumn($col); $col = new base_install_Column('picture'); $col->setType(base_install_Column::VARCHAR)->setLength(400); $table->addColumn($col); $col = new base_install_Column('description'); $col->setType(base_install_Column::TEXT); $table->addColumn($col); $manager->addTable($table);
$manager->addTable($table); /** --------------- table News ---------------*/ $table = new base_install_table_BaseObject('news'); $col = new base_install_Column('title'); $col->setType(base_install_Column::VARCHAR)->setLength(400); $table->addColumn($col); $col = new base_install_Column('content'); $col->setType(base_install_Column::TEXT); $table->addColumn($col); $manager->addTable($table); /** --------------- table datapermission ---------------*/ $table = new base_install_Table('datapermission'); $col = new base_install_Column('PK'); $col->setAutoIncrement()->setPrimary()->setType(base_install_Column::INT); $table->addColumn($col); $col = new base_install_Column('objClass'); $col->setType(base_install_Column::VARCHAR)->setLength(400); $table->addColumn($col); $col = new base_install_Column('dpClass'); $col->setType(base_install_Column::VARCHAR)->setLength(400); $table->addColumn($col); $manager->addTable($table);
public function addColumn(base_install_Column $column) { $this->columns[] = $column->toString(); }
<?php /** * Created by PhpStorm. * User: Alex * Date: 11.01.2015 * Time: 10:26 */ $manager = base_install_Manager::get(); /** --------------- table incident ---------------*/ $table = new base_install_table_BaseObject('incident'); $col = new base_install_Column('title'); $col->setType(base_install_Column::VARCHAR)->setLength(400); $table->addColumn($col); $col = new base_install_Column('description'); $col->setType(base_install_Column::TEXT); $table->addColumn($col); $col = new base_install_Column('priority'); $col->setType(base_install_Column::INT)->setLength(2); $table->addColumn($col); $manager->addTable($table);