1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
<?php
abstract class Basemyapp_item extends sfDoctrineRecord
{
public function setTableDefinition()
{
$this->setTableName('myapp_item');
$this->hasColumn('id', 'integer', 4, array(
'type' => 'integer',
'autoincrement' => true,
'primary' => true,
'length' => '4',
));
$this->hasColumn('types_id', 'integer', 4, array(
'type' => 'integer',
'notnull' => true,
'length' => '4',
));
$this->hasColumn('categories_id', 'integer', 4, array(
'type' => 'integer',
'notnull' => true,
'length' => '4',
));
$this->hasColumn('users_id', 'integer', 4, array(
'type' => 'integer',
'notnull' => true,
'length' => '4',
));
$this->hasColumn('reference', 'string', 32, array(
'type' => 'string',
'notnull' => true,
'unique' => true,
'length' => '32',
));
$this->hasColumn('surface', 'float', null, array(
'type' => 'float',
));
$this->hasColumn('created_at', '', null);
$this->hasColumn('updated_at', '', null);
}
public function setUp()
{
$this->hasOne('myapp_types', array(
'local' => 'types_id',
'foreign' => 'id',
'onDelete' => 'RESTRICT',
'onUpdate' => 'CASCADE'));
$this->hasOne('myapp_categories', array(
'local' => 'categories_id',
'foreign' => 'id',
'onDelete' => 'RESTRICT',
'onUpdate' => 'CASCADE'));
$this->hasOne('myapp_users', array(
'local' => 'users_id',
'foreign' => 'id',
'onDelete' => 'RESTRICT',
'onUpdate' => 'CASCADE'));
$timestampable0 = new Doctrine_Template_Timestampable();
$this->actAs($timestampable0);
}
} |
Partager