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
|
abstract class Baseuser extends sfDoctrineRecord
{
public function setTableDefinition()
{
$this->setTableName('users');
$this->hasColumn('fullname', 'string', 100, array(
'type' => 'string',
'length' => 100,
));
$this->hasColumn('email', 'string', 160, array(
'type' => 'string',
'length' => 160,
));
$this->hasColumn('password', 'string', 32, array(
'type' => 'string',
'length' => 32,
));
...
$this->option('collate', 'utf8_general_ci');
$this->option('charset', 'utf8');
$this->option('type', 'InnoDB');
}
public function setUp()
{
parent::setUp();
$this->hasOne('country', array(
'local' => 'country_id',
'foreign' => 'id',
'onDelete' => 'cascade'));
$this->hasMany('visite as visites', array(
'local' => 'id',
'foreign' => 'user_id'));
$this->hasMany('friend as friends', array(
'local' => 'id',
'foreign' => 'user_id'));
$this->hasMany('listener as listeners', array(
'local' => 'id',
'foreign' => 'user_id'));
$timestampable0 = new Doctrine_Template_Timestampable();
$this->actAs($timestampable0);
}
} |