php mapping
This commit is contained in:
parent
6a89de51e5
commit
7f0275155d
@ -147,10 +147,9 @@ class AnnotationDriver implements Driver
|
||||
// Evaluate Entity annotation
|
||||
if (isset($classAnnotations['Doctrine\ORM\Mapping\Entity'])) {
|
||||
$entityAnnot = $classAnnotations['Doctrine\ORM\Mapping\Entity'];
|
||||
if($entityAnnot->repositoryClass !== null) {
|
||||
if ($entityAnnot->repositoryClass !== null) {
|
||||
$metadata->setCustomRepositoryClass($entityAnnot->repositoryClass);
|
||||
}
|
||||
|
||||
if ($entityAnnot->readOnly) {
|
||||
$metadata->markReadOnly();
|
||||
}
|
||||
|
@ -28,5 +28,13 @@ class DDC869ChequePayment extends DDC869Payment
|
||||
|
||||
/** @column(type="string") */
|
||||
protected $serialNumber;
|
||||
|
||||
public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata)
|
||||
{
|
||||
$metadata->mapField(array(
|
||||
'fieldName' => 'serialNumber',
|
||||
'type' => 'string',
|
||||
));
|
||||
}
|
||||
|
||||
}
|
@ -28,5 +28,13 @@ class DDC869CreditCardPayment extends DDC869Payment
|
||||
|
||||
/** @column(type="string") */
|
||||
protected $creditCardNumber;
|
||||
|
||||
public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata)
|
||||
{
|
||||
$metadata->mapField(array(
|
||||
'fieldName' => 'creditCardNumber',
|
||||
'type' => 'string',
|
||||
));
|
||||
}
|
||||
|
||||
}
|
@ -35,5 +35,22 @@ class DDC869Payment
|
||||
|
||||
/** @column(type="float") */
|
||||
protected $value;
|
||||
|
||||
|
||||
public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata)
|
||||
{
|
||||
$metadata->mapField(array(
|
||||
'id' => true,
|
||||
'fieldName' => 'id',
|
||||
'type' => 'integer',
|
||||
'columnName' => 'id',
|
||||
));
|
||||
$metadata->mapField(array(
|
||||
'fieldName' => 'value',
|
||||
'type' => 'float',
|
||||
));
|
||||
$metadata->setCustomRepositoryClass("Doctrine\Tests\Models\DDC869\DDC869PaymentRepository");
|
||||
$metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadataInfo::GENERATOR_TYPE_AUTO);
|
||||
}
|
||||
|
||||
}
|
@ -297,10 +297,6 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase
|
||||
*/
|
||||
public function testMappedSuperclassWithRepository()
|
||||
{
|
||||
if (strpos(get_class($this), 'PHPMappingDriver') !== false) {
|
||||
$this->markTestSkipped('PHP Mapping Drivers have no defaults.');
|
||||
}
|
||||
|
||||
$driver = $this->_loadDriver();
|
||||
$em = $this->_getTestEntityManager();
|
||||
$factory = new \Doctrine\ORM\Mapping\ClassMetadataFactory();
|
||||
|
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
$metadata->mapField(array(
|
||||
'fieldName' => 'serialNumber',
|
||||
'type' => 'string',
|
||||
));
|
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
$metadata->mapField(array(
|
||||
'fieldName' => 'creditCardNumber',
|
||||
'type' => 'string',
|
||||
));
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
||||
|
||||
$metadata->mapField(array(
|
||||
'id' => true,
|
||||
'fieldName' => 'id',
|
||||
'type' => 'integer',
|
||||
'columnName' => 'id',
|
||||
));
|
||||
$metadata->mapField(array(
|
||||
'fieldName' => 'value',
|
||||
'type' => 'float',
|
||||
));
|
||||
$metadata->setCustomRepositoryClass("Doctrine\Tests\Models\DDC869\DDC869PaymentRepository");
|
||||
$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO);
|
Loading…
Reference in New Issue
Block a user