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

23 lines
769 B
PHP

<?php
class ForeignKeyTest extends Doctrine_Entity
{
public static function initMetadata($class)
{
$class->setColumn('name', 'string', null);
$class->setColumn('code', 'integer', 4);
$class->setColumn('content', 'string', 4000);
$class->setColumn('parent_id', 'integer');
$class->hasOne('ForeignKeyTest as Parent',
array('local' => 'parent_id',
'foreign' => 'id',
'onDelete' => 'CASCADE',
'onUpdate' => 'RESTRICT')
);
$class->hasMany('ForeignKeyTest as Children', array('local' => 'id', 'foreign' => 'parent_id'));
$class->setTableOption('type', 'INNODB');
}
}