1
0
mirror of synced 2024-12-13 14:56:01 +03:00
doctrine2/models/InheritanceDealUser.php

36 lines
1.1 KiB
PHP

<?php
class InheritanceEntityUser extends Doctrine_Record
{
public function setTableDefinition()
{
$this->setInheritanceType(Doctrine::INHERITANCETYPE_SINGLE_TABLE,
array('InheritanceDealUser' => array('type' => 1)));
$this->setTableName('inheritance_entity_user');
$this->hasColumn('type', 'integer', 4, array ( 'primary' => true,));
$this->hasColumn('user_id', 'integer', 4, array ( 'primary' => true,));
$this->hasColumn('entity_id', 'integer', 4, array ( 'primary' => true,));
}
public function setUp()
{
}
}
class InheritanceDealUser extends InheritanceEntityUser
{
public function setTableDefinition()
{
$this->hasColumn('user_id', 'integer', 4, array ( 'primary' => true,));
$this->hasColumn('entity_id', 'integer', 4, array ( 'primary' => true,));
}
public function setUp()
{
parent::setUp();
$this->hasOne('InheritanceUser as User', array('local' => 'user_id', 'foreign' => 'id'));
$this->hasOne('InheritanceDeal as Deal', array('local' => 'entity_id', 'foreign' => 'id'));
}
}