DoctrineAnnotations.php 3.95 KB
Newer Older
1
<?php
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*
 *  $Id$
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * This software consists of voluntary contributions made by many individuals
 * and is licensed under the LGPL. For more information, see
 * <http://www.doctrine-project.org>.
20 21
 */

romanb's avatar
romanb committed
22 23
namespace Doctrine\ORM\Mapping;

24
use Doctrine\Common\Annotations\Annotation;
25

26 27
/* Annotations */

28
final class Entity extends Annotation {
29 30
    public $repositoryClass;
}
31
final class MappedSuperclass extends Annotation {}
32 33
final class InheritanceType extends Annotation {}
final class DiscriminatorColumn extends Annotation {
34
    public $name;
35
    public $fieldName; // field name used in non-object hydration (array/scalar)
36 37 38
    public $type;
    public $length;
}
39 40 41 42
final class DiscriminatorMap extends Annotation {}
/*final class SubClasses extends Annotation {}*/
final class Id extends Annotation {}
final class GeneratedValue extends Annotation {
43 44
    public $strategy;
}
45 46
final class Version extends Annotation {}
final class JoinColumn extends Annotation {
47
    public $name;
48
    public $fieldName; // field name used in non-object hydration (array/scalar)
49 50 51
    public $referencedColumnName;
    public $unique = false;
    public $nullable = true;
52 53 54
    public $onDelete;
    public $onUpdate;
}
55 56
final class JoinColumns extends Annotation {}
final class Column extends Annotation {
57 58
    public $type;
    public $length;
59 60
    public $unique = false;
    public $nullable = false;
61
    public $default;
62
    public $name;
63
}
64
final class OneToOne extends Annotation {
65 66 67
    public $targetEntity;
    public $mappedBy;
    public $cascade;
68 69
    public $fetch;
    public $optional;
70
    public $orphanRemoval = false;
71
}
72
final class OneToMany extends Annotation {
73 74 75
    public $mappedBy;
    public $targetEntity;
    public $cascade;
76
    public $fetch;
77
    public $orphanRemoval = false;
78
}
79
final class ManyToOne extends Annotation {
80 81
    public $targetEntity;
    public $cascade;
82 83
    public $fetch;
    public $optional;
84
}
85
final class ManyToMany extends Annotation {
86 87 88
    public $targetEntity;
    public $mappedBy;
    public $cascade;
89
    public $fetch;
90
}
91
final class ElementCollection extends Annotation {
92 93
    public $tableName;
}
94
final class Table extends Annotation {
95 96
    public $name;
    public $schema;
97 98 99 100 101 102 103 104 105 106
    public $indexes;
    public $uniqueConstraints;
}
final class UniqueConstraint extends Annotation {
    public $name;
    public $columns;
}
final class Index extends Annotation {
    public $name;
    public $columns;
107
}
108
final class JoinTable extends Annotation {
109 110 111 112
    public $name;
    public $schema;
    public $joinColumns;
    public $inverseJoinColumns;
113
}
114
final class SequenceGenerator extends Annotation {
115
    public $sequenceName;
116
    public $allocationSize = 10;
117
    public $initialValue = 1;
118
}
119
final class ChangeTrackingPolicy extends Annotation {}
120 121

/* Annotations for lifecycle callbacks */
122 123 124 125 126 127 128 129
final class LifecycleListener extends Annotation {}
final class PrePersist extends Annotation {}
final class PostPersist extends Annotation {}
final class PreUpdate extends Annotation {}
final class PostUpdate extends Annotation {}
final class PreRemove extends Annotation {}
final class PostRemove extends Annotation {}
final class PostLoad extends Annotation {}
130 131

/* Generic annotation for Doctrine extensions */
132
final class DoctrineX extends Annotation {}