added support for @Enum
This commit is contained in:
parent
0d58e6627a
commit
a07c63dde6
@ -25,6 +25,10 @@ namespace Doctrine\ORM\Mapping;
|
||||
*/
|
||||
final class ChangeTrackingPolicy implements Annotation
|
||||
{
|
||||
/** @var string */
|
||||
/**
|
||||
* @var string The change tracking policy.
|
||||
*
|
||||
* @Enum({"DEFERRED_IMPLICIT", "DEFERRED_EXPLICIT", "NOTIFY"})
|
||||
*/
|
||||
public $value;
|
||||
}
|
||||
}
|
@ -25,6 +25,10 @@ namespace Doctrine\ORM\Mapping;
|
||||
*/
|
||||
final class GeneratedValue implements Annotation
|
||||
{
|
||||
/** @var string */
|
||||
/**
|
||||
* @var string The type of Id generator.
|
||||
*
|
||||
* @Enum({"AUTO", "SEQUENCE", "TABLE", "IDENTITY", "NONE", "UUID", "CUSTOM"})
|
||||
*/
|
||||
public $strategy = 'AUTO';
|
||||
}
|
||||
|
@ -25,6 +25,10 @@ namespace Doctrine\ORM\Mapping;
|
||||
*/
|
||||
final class InheritanceType implements Annotation
|
||||
{
|
||||
/** @var string */
|
||||
/**
|
||||
* @var string The inheritance type used by the class and it's subclasses.
|
||||
*
|
||||
* @Enum({"NONE", "JOINED", "SINGLE_TABLE", "TABLE_PER_CLASS"})
|
||||
*/
|
||||
public $value;
|
||||
}
|
||||
|
@ -25,18 +25,40 @@ namespace Doctrine\ORM\Mapping;
|
||||
*/
|
||||
final class ManyToMany implements Annotation
|
||||
{
|
||||
/** @var string */
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $targetEntity;
|
||||
/** @var string */
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $mappedBy;
|
||||
/** @var string */
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $inversedBy;
|
||||
/** @var array<string> */
|
||||
|
||||
/**
|
||||
* @var array<string>
|
||||
*/
|
||||
public $cascade;
|
||||
/** @var string */
|
||||
|
||||
/**
|
||||
* @var string The fetching strategy to use for the association.
|
||||
*
|
||||
* @Enum({"LAZY", "EAGER", "EXTRA_LAZY"})
|
||||
*/
|
||||
public $fetch = 'LAZY';
|
||||
/** @var boolean */
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*/
|
||||
public $orphanRemoval = false;
|
||||
/** @var string */
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $indexBy;
|
||||
}
|
||||
}
|
@ -25,12 +25,25 @@ namespace Doctrine\ORM\Mapping;
|
||||
*/
|
||||
final class ManyToOne implements Annotation
|
||||
{
|
||||
/** @var string */
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $targetEntity;
|
||||
/** @var array<string> */
|
||||
|
||||
/**
|
||||
* @var array<string>
|
||||
*/
|
||||
public $cascade;
|
||||
/** @var string */
|
||||
|
||||
/**
|
||||
* @var string The fetching strategy to use for the association.
|
||||
*
|
||||
* @Enum({"LAZY", "EAGER", "EXTRA_LAZY"})
|
||||
*/
|
||||
public $fetch = 'LAZY';
|
||||
/** @var string */
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $inversedBy;
|
||||
}
|
||||
}
|
@ -25,16 +25,35 @@ namespace Doctrine\ORM\Mapping;
|
||||
*/
|
||||
final class OneToMany implements Annotation
|
||||
{
|
||||
/** @var string */
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $mappedBy;
|
||||
/** @var string */
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $targetEntity;
|
||||
/** @var array<string> */
|
||||
|
||||
/**
|
||||
* @var array<string>
|
||||
*/
|
||||
public $cascade;
|
||||
/** @var string */
|
||||
|
||||
/**
|
||||
* @var string The fetching strategy to use for the association.
|
||||
*
|
||||
* @Enum({"LAZY", "EAGER", "EXTRA_LAZY"})
|
||||
*/
|
||||
public $fetch = 'LAZY';
|
||||
/** @var boolean */
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*/
|
||||
public $orphanRemoval = false;
|
||||
/** @var string */
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $indexBy;
|
||||
}
|
||||
|
@ -25,16 +25,35 @@ namespace Doctrine\ORM\Mapping;
|
||||
*/
|
||||
final class OneToOne implements Annotation
|
||||
{
|
||||
/** @var string */
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $targetEntity;
|
||||
/** @var string */
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $mappedBy;
|
||||
/** @var string */
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $inversedBy;
|
||||
/** @var array<string> */
|
||||
|
||||
/**
|
||||
* @var array<string>
|
||||
*/
|
||||
public $cascade;
|
||||
/** @var string */
|
||||
|
||||
/**
|
||||
* @var string The fetching strategy to use for the association.
|
||||
*
|
||||
* @Enum({"LAZY", "EAGER", "EXTRA_LAZY"})
|
||||
*/
|
||||
public $fetch = 'LAZY';
|
||||
/** @var boolean */
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*/
|
||||
public $orphanRemoval = false;
|
||||
}
|
||||
}
|
2
lib/vendor/doctrine-common
vendored
2
lib/vendor/doctrine-common
vendored
@ -1 +1 @@
|
||||
Subproject commit 0f7ba7fa7179bf445779f63fe5ccad355c81c06b
|
||||
Subproject commit cab6ec62f72c9af5d444c2b4fffe3ebcacac2479
|
@ -211,8 +211,8 @@ class AnnotationDriverTest extends AbstractMappingDriverTest
|
||||
$factory = new \Doctrine\ORM\Mapping\ClassMetadataFactory();
|
||||
$factory->setEntityManager($em);
|
||||
|
||||
$this->setExpectedException('Doctrine\ORM\Mapping\MappingException',
|
||||
"Entity 'Doctrine\Tests\ORM\Mapping\InvalidFetchOption' has a mapping with invalid fetch mode 'eager");
|
||||
$this->setExpectedException('Doctrine\Common\Annotations\AnnotationException',
|
||||
'[Enum Error] Attribute "fetch" of @Doctrine\ORM\Mapping\OneToMany declared on property Doctrine\Tests\ORM\Mapping\InvalidFetchOption::$collection accept only [LAZY, EAGER, EXTRA_LAZY], but got eager.');
|
||||
$cm = $factory->getMetadataFor('Doctrine\Tests\ORM\Mapping\InvalidFetchOption');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user