DoctrineAnnotations.php 4.29 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
    public $strategy = 'AUTO';
44
}
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
    public $referencedColumnName = 'id';
50 51
    public $unique = false;
    public $nullable = true;
52 53
    public $onDelete;
    public $onUpdate;
54
    public $columnDefinition;
55
}
56 57
final class JoinColumns extends Annotation {}
final class Column extends Annotation {
58
    public $type = 'string';
59
    public $length;
60 61 62 63
    // The precision for a decimal (exact numeric) column (Applies only for decimal column)
    public $precision = 0;
    // The scale for a decimal (exact numeric) column (Applies only for decimal column)
    public $scale = 0;
64 65
    public $unique = false;
    public $nullable = false;
66
    public $name;
67
    public $options = array();
68
    public $columnDefinition;
69
}
70
final class OneToOne extends Annotation {
71 72
    public $targetEntity;
    public $mappedBy;
73
    public $inversedBy;
74
    public $cascade;
75
    public $fetch = 'LAZY';
76
    public $orphanRemoval = false;
77
}
78
final class OneToMany extends Annotation {
79 80 81
    public $mappedBy;
    public $targetEntity;
    public $cascade;
82
    public $fetch = 'LAZY';
83
    public $orphanRemoval = false;
84
}
85
final class ManyToOne extends Annotation {
86 87
    public $targetEntity;
    public $cascade;
88
    public $fetch = 'LAZY';
89
    public $inversedBy;
90
}
91
final class ManyToMany extends Annotation {
92 93
    public $targetEntity;
    public $mappedBy;
94
    public $inversedBy;
95
    public $cascade;
96
    public $fetch = 'LAZY';
97
}
98
final class ElementCollection extends Annotation {
99 100
    public $tableName;
}
101
final class Table extends Annotation {
102 103
    public $name;
    public $schema;
104 105 106 107 108 109 110 111 112 113
    public $indexes;
    public $uniqueConstraints;
}
final class UniqueConstraint extends Annotation {
    public $name;
    public $columns;
}
final class Index extends Annotation {
    public $name;
    public $columns;
114
}
115
final class JoinTable extends Annotation {
116 117 118 119
    public $name;
    public $schema;
    public $joinColumns;
    public $inverseJoinColumns;
120
}
121
final class SequenceGenerator extends Annotation {
122
    public $sequenceName;
123
    public $allocationSize = 10;
124
    public $initialValue = 1;
125
}
126
final class ChangeTrackingPolicy extends Annotation {}
127

128 129
final class OrderBy extends Annotation {}

130
/* Annotations for lifecycle callbacks */
131
final class HasLifecycleCallbacks extends Annotation {}
132 133 134 135 136 137 138
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 {}
139