Anc lib timetables backend: Unterschied zwischen den Versionen
Aus Vosp.info
V (Diskussion | Beiträge) |
V (Diskussion | Beiträge) |
||
Zeile 1: | Zeile 1: | ||
− | |||
== Struktur == | == Struktur == | ||
Zeile 34: | Zeile 33: | ||
<source lang="php"> | <source lang="php"> | ||
<?php | <?php | ||
+ | $installer = $this; | ||
+ | $installer->startSetup(); | ||
+ | $tableName = $installer->getTable('anc_lib/timetable'); | ||
+ | if ($installer->getConnection()->isTableExists($tableName) != true) { | ||
+ | $table = $installer->getConnection()->newTable($tableName) | ||
+ | ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true,), 'Id') | ||
+ | ->addColumn('name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(), 'Name') | ||
+ | ->addColumn('comment', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(), 'comment') | ||
+ | ->addColumn('admin_user_id', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('unsigned' => true,'nullable' => false,'default' => '0',),'Who Created backend') | ||
+ | ->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => false, 'default' => '0',), 'Who Created frontend') | ||
+ | ->addColumn('start', Varien_Db_Ddl_Table::TYPE_TIMESTAMP,null,array(),'Start Date as Timestamp') | ||
+ | ->addColumn('stop', Varien_Db_Ddl_Table::TYPE_TIMESTAMP,null,array(),'End Date as Timestamp') | ||
+ | ->addColumn('starthour', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '0'),'Daily start Hour') | ||
+ | ->addColumn('stophour', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '23'),'Daily stop Hour') | ||
+ | ->addColumn('startmin', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '0'),'Daily start Min') | ||
+ | ->addColumn('stopmin', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '59'),'Daily stop Min') | ||
+ | ->addColumn('monday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Mondays') | ||
+ | ->addColumn('tuesday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Tuesday') | ||
+ | ->addColumn('wednesday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Wednesday') | ||
+ | ->addColumn('thursday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Thursday') | ||
+ | ->addColumn('friday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Friday') | ||
+ | ->addColumn('saturday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Saturday') | ||
+ | ->addColumn('sunday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Sunday') | ||
+ | ->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'When beginn') | ||
+ | ->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'When updated') | ||
+ | ->addColumn('deleted', Varien_Db_Ddl_Table::TYPE_TINYINT, null, array('default' => '0'), 'Deleted') | ||
+ | ; | ||
+ | $installer->getConnection()->createTable($table); | ||
+ | } | ||
+ | |||
+ | |||
+ | $installer->endSetup(); | ||
?> | ?> | ||
</source> | </source> |
Version vom 31. Mai 2014, 08:33 Uhr
Inhaltsverzeichnis
Struktur
Blöcke
../Block/Adminhtml/Timetables.php ../Block/Adminhtml/Timetables ../Block/Adminhtml/Timetables/Grid.php ../Block/Adminhtml/Timetables/Edit.php ../Block/Adminhtml/Timetables/Edit ../Block/Adminhtml/Timetables/Edit/Form.php ../Block/Adminhtml/Timetables/Edit/Tabs.php ../Block/Adminhtml/Timetables/Edit/Tab ../Block/Adminhtml/Timetables/Edit/Tab/Form.php ../Block/Adminhtml/Timetables/Edit/Tab/Content.php
Helper
../Helper/Data.php
Model
../Model/Resource/Mysql4/Timetable/Collection.php ../Model/Resource/Mysql4/Timetable.php
Controller.php
../controllers/Adminhtml/TimetableController.php
etc
../etc/config.xml ../etc/adminhtml.xml
sql
../sql/anc_lib_setup/install-0.1.0.php
<?php
$installer = $this;
$installer->startSetup();
$tableName = $installer->getTable('anc_lib/timetable');
if ($installer->getConnection()->isTableExists($tableName) != true) {
$table = $installer->getConnection()->newTable($tableName)
->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true,), 'Id')
->addColumn('name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(), 'Name')
->addColumn('comment', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(), 'comment')
->addColumn('admin_user_id', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('unsigned' => true,'nullable' => false,'default' => '0',),'Who Created backend')
->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => false, 'default' => '0',), 'Who Created frontend')
->addColumn('start', Varien_Db_Ddl_Table::TYPE_TIMESTAMP,null,array(),'Start Date as Timestamp')
->addColumn('stop', Varien_Db_Ddl_Table::TYPE_TIMESTAMP,null,array(),'End Date as Timestamp')
->addColumn('starthour', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '0'),'Daily start Hour')
->addColumn('stophour', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '23'),'Daily stop Hour')
->addColumn('startmin', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '0'),'Daily start Min')
->addColumn('stopmin', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '59'),'Daily stop Min')
->addColumn('monday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Mondays')
->addColumn('tuesday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Tuesday')
->addColumn('wednesday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Wednesday')
->addColumn('thursday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Thursday')
->addColumn('friday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Friday')
->addColumn('saturday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Saturday')
->addColumn('sunday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Sunday')
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'When beginn')
->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'When updated')
->addColumn('deleted', Varien_Db_Ddl_Table::TYPE_TINYINT, null, array('default' => '0'), 'Deleted')
;
$installer->getConnection()->createTable($table);
}
$installer->endSetup();
?>