2007-09-02 18:24:49 +04:00
|
|
|
<?php
|
|
|
|
class ColumnAliasTest extends Doctrine_Record
|
|
|
|
{
|
|
|
|
public function setTableDefinition()
|
|
|
|
{
|
|
|
|
$this->hasColumn('column1 as alias1', 'string', 200);
|
2007-11-18 19:06:37 +03:00
|
|
|
$this->hasColumn('column2 as alias2', 'integer', 4);
|
|
|
|
$this->hasColumn('another_column as anotherField', 'string', 50);
|
|
|
|
$this->hasColumn('book_id as bookId', 'integer', 4);
|
2007-09-02 18:24:49 +04:00
|
|
|
}
|
2007-11-18 19:06:37 +03:00
|
|
|
public function setUp()
|
2007-09-02 18:24:49 +04:00
|
|
|
{
|
2007-11-18 19:06:37 +03:00
|
|
|
$this->hasOne('Book as book', array('local' => 'book_id', 'foreign' => 'id'));
|
2007-09-02 18:24:49 +04:00
|
|
|
}
|
|
|
|
}
|