DoctrineAnnotations.php 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <?php
  2. /*
  3. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  4. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  5. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  6. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  10. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  11. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  12. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  13. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. *
  15. * This software consists of voluntary contributions made by many individuals
  16. * and is licensed under the LGPL. For more information, see
  17. * <http://www.doctrine-project.org>.
  18. */
  19. namespace Doctrine\ORM\Mapping;
  20. use Doctrine\Common\Annotations\Annotation;
  21. /* Annotations */
  22. /** @Annotation */
  23. final class Entity extends Annotation {
  24. public $repositoryClass;
  25. public $readOnly = false;
  26. }
  27. /** @Annotation */
  28. final class MappedSuperclass extends Annotation {}
  29. /** @Annotation */
  30. final class InheritanceType extends Annotation {}
  31. /** @Annotation */
  32. final class DiscriminatorColumn extends Annotation {
  33. public $name;
  34. public $fieldName; // field name used in non-object hydration (array/scalar)
  35. public $type;
  36. public $length;
  37. }
  38. /** @Annotation */
  39. final class DiscriminatorMap extends Annotation {}
  40. /** @Annotation */
  41. final class Id extends Annotation {}
  42. /** @Annotation */
  43. final class GeneratedValue extends Annotation {
  44. public $strategy = 'AUTO';
  45. }
  46. /** @Annotation */
  47. final class Version extends Annotation {}
  48. /** @Annotation */
  49. final class JoinColumn extends Annotation {
  50. public $name;
  51. public $fieldName; // field name used in non-object hydration (array/scalar)
  52. public $referencedColumnName = 'id';
  53. public $unique = false;
  54. public $nullable = true;
  55. public $onDelete;
  56. public $onUpdate;
  57. public $columnDefinition;
  58. }
  59. /** @Annotation */
  60. final class JoinColumns extends Annotation {}
  61. /** @Annotation */
  62. final class Column extends Annotation {
  63. public $type = 'string';
  64. public $length;
  65. // The precision for a decimal (exact numeric) column (Applies only for decimal column)
  66. public $precision = 0;
  67. // The scale for a decimal (exact numeric) column (Applies only for decimal column)
  68. public $scale = 0;
  69. public $unique = false;
  70. public $nullable = false;
  71. public $name;
  72. public $options = array();
  73. public $columnDefinition;
  74. }
  75. /** @Annotation */
  76. final class OneToOne extends Annotation {
  77. public $targetEntity;
  78. public $mappedBy;
  79. public $inversedBy;
  80. public $cascade;
  81. public $fetch = 'LAZY';
  82. public $orphanRemoval = false;
  83. }
  84. /** @Annotation */
  85. final class OneToMany extends Annotation {
  86. public $mappedBy;
  87. public $targetEntity;
  88. public $cascade;
  89. public $fetch = 'LAZY';
  90. public $orphanRemoval = false;
  91. public $indexBy;
  92. }
  93. /** @Annotation */
  94. final class ManyToOne extends Annotation {
  95. public $targetEntity;
  96. public $cascade;
  97. public $fetch = 'LAZY';
  98. public $inversedBy;
  99. }
  100. /** @Annotation */
  101. final class ManyToMany extends Annotation {
  102. public $targetEntity;
  103. public $mappedBy;
  104. public $inversedBy;
  105. public $cascade;
  106. public $fetch = 'LAZY';
  107. public $indexBy;
  108. }
  109. /** @Annotation */
  110. final class ElementCollection extends Annotation {
  111. public $tableName;
  112. }
  113. /** @Annotation */
  114. final class Table extends Annotation {
  115. public $name;
  116. public $schema;
  117. public $indexes;
  118. public $uniqueConstraints;
  119. }
  120. /** @Annotation */
  121. final class UniqueConstraint extends Annotation {
  122. public $name;
  123. public $columns;
  124. }
  125. /** @Annotation */
  126. final class Index extends Annotation {
  127. public $name;
  128. public $columns;
  129. }
  130. /** @Annotation */
  131. final class JoinTable extends Annotation {
  132. public $name;
  133. public $schema;
  134. public $joinColumns = array();
  135. public $inverseJoinColumns = array();
  136. }
  137. /** @Annotation */
  138. final class SequenceGenerator extends Annotation {
  139. public $sequenceName;
  140. public $allocationSize = 1;
  141. public $initialValue = 1;
  142. }
  143. /** @Annotation */
  144. final class ChangeTrackingPolicy extends Annotation {}
  145. /** @Annotation */
  146. final class OrderBy extends Annotation {}
  147. /** @Annotation */
  148. final class NamedQueries extends Annotation {}
  149. /** @Annotation */
  150. final class NamedQuery extends Annotation {
  151. public $name;
  152. public $query;
  153. }
  154. /* Annotations for lifecycle callbacks */
  155. /** @Annotation */
  156. final class HasLifecycleCallbacks extends Annotation {}
  157. /** @Annotation */
  158. final class PrePersist extends Annotation {}
  159. /** @Annotation */
  160. final class PostPersist extends Annotation {}
  161. /** @Annotation */
  162. final class PreUpdate extends Annotation {}
  163. /** @Annotation */
  164. final class PostUpdate extends Annotation {}
  165. /** @Annotation */
  166. final class PreRemove extends Annotation {}
  167. /** @Annotation */
  168. final class PostRemove extends Annotation {}
  169. /** @Annotation */
  170. final class PostLoad extends Annotation {}