1
0
mirror of synced 2024-12-14 23:26:04 +03:00
doctrine2/models/Book.php

17 lines
491 B
PHP
Raw Normal View History

<?php
class Book extends Doctrine_Record
{
public function setUp()
{
$this->hasMany('Author', array('local' => 'id', 'foreign' => 'book_id'));
$this->hasOne('User', array('local' => 'user_id',
'foreign' => 'id',
'onDelete' => 'CASCADE'));
}
public function setTableDefinition()
{
$this->hasColumn('user_id', 'integer');
$this->hasColumn('name', 'string',20);
}
}