2007-09-02 18:24:49 +04:00
|
|
|
<?php
|
2007-09-05 08:42:02 +04:00
|
|
|
class Album extends Doctrine_Record
|
|
|
|
{
|
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
$this->hasMany('Song', array('local' => 'id', 'foreign' => 'album_id'));
|
|
|
|
$this->hasOne('User', array('local' => 'user_id',
|
|
|
|
'foreign' => 'id',
|
|
|
|
'onDelete' => 'CASCADE'));
|
2007-09-02 18:24:49 +04:00
|
|
|
}
|
2007-09-05 08:42:02 +04:00
|
|
|
public function setTableDefinition()
|
|
|
|
{
|
2007-09-02 18:24:49 +04:00
|
|
|
$this->hasColumn('user_id', 'integer');
|
|
|
|
$this->hasColumn('name', 'string',20);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|