root/tags/0.10.1/models/Album.php

Revision 2420, 492 bytes (checked in by jackbravo, 16 months ago)

Update syntax for relationships on models

Line 
1<?php
2class Album extends Doctrine_Record
3{
4    public function setUp()
5    {
6        $this->hasMany('Song', array('local' => 'id', 'foreign' => 'album_id'));
7        $this->hasOne('User', array('local' => 'user_id',
8                                    'foreign' => 'id',
9                                    'onDelete' => 'CASCADE'));
10    }
11    public function setTableDefinition()
12    {
13        $this->hasColumn('user_id', 'integer');
14        $this->hasColumn('name', 'string',20);
15    }
16}
Note: See TracBrowser for help on using the browser.