1
0
mirror of synced 2024-12-13 06:46:03 +03:00
doctrine2/models/TestMovie.php

26 lines
831 B
PHP

<?php
class TestMovie extends Doctrine_Record
{
public static function initMetadata($class)
{
$class->setColumn('user_id', 'integer', null);
$class->setColumn('name', 'string', 30);
$class->hasOne('TestUser as User',
array('local' => 'user_id',
'foreign' => 'id'));
$class->hasMany('TestUser as MovieBookmarks',
array('local' => 'movie_id',
'foreign' => 'user_id',
'refClass' => 'TestMovieUserBookmark'));
$class->hasMany('TestUser as MovieVotes',
array('local' => 'movie_id',
'foreign' => 'user_id',
'refClass' => 'TestMovieUserVote'));
}
}