1
0
mirror of synced 2024-12-15 15:46:02 +03:00
doctrine2/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyPerson.php
Fabio B. Silva 9c87b5c689 php driver
2012-04-15 15:40:42 -03:00

39 lines
1.1 KiB
PHP

<?php
use Doctrine\ORM\Mapping\ClassMetadataInfo;
$metadata->setPrimaryTable(array(
'name' => 'company_person',
));
$metadata->addNamedNativeQuery(array (
'name' => 'fetchAllWithResultClass',
'query' => 'SELECT id, name, discr FROM company_persons ORDER BY name',
'resultClass' => 'Doctrine\\Tests\\Models\\Company\\CompanyPerson',
));
$metadata->addNamedNativeQuery(array (
'name' => 'fetchAllWithSqlResultSetMapping',
'query' => 'SELECT id, name, discr AS discriminator FROM company_persons ORDER BY name',
'resultSetMapping' => 'mappingFetchAll',
));
$metadata->addSqlResultSetMapping(array (
'name' => 'mappingFetchAll',
'columns' => array(),
'entities' => array ( array (
'fields' => array (
array (
'name' => 'id',
'column' => 'id',
),
array (
'name' => 'name',
'column' => 'name',
),
),
'entityClass' => 'Doctrine\Tests\Models\Company\CompanyPerson',
'discriminatorColumn' => 'discriminator',
),
),
));