1
0
mirror of synced 2024-12-15 23:56:02 +03:00
doctrine2/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php

390 lines
8.0 KiB
PHP
Raw Normal View History

<?php
/*
* 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>.
*/
2009-07-15 14:59:35 +04:00
namespace Doctrine\ORM\Mapping;
abstract class Annotation {}
/* Annotations */
/**
* @Annotation
* @Target("CLASS")
*/
final class Entity extends Annotation {
/** @var string */
public $repositoryClass;
/** @var boolean */
public $readOnly = false;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("CLASS")
*/
final class MappedSuperclass extends Annotation {
/** @var string */
public $repositoryClass;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("CLASS")
*/
final class InheritanceType extends Annotation {
/** @var string */
public $value;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("CLASS")
*/
final class DiscriminatorColumn extends Annotation {
/** @var string */
public $name;
/** @var string */
public $type;
/** @var integer */
public $length;
/** @var mixed */
public $fieldName; // field name used in non-object hydration (array/scalar)
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("CLASS")
*/
final class DiscriminatorMap extends Annotation {
/** @var array<string> */
public $value;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("PROPERTY")
*/
final class Id extends Annotation {}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("PROPERTY")
*/
final class GeneratedValue extends Annotation {
/** @var string */
public $strategy = 'AUTO';
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("PROPERTY")
*/
final class Version extends Annotation {}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target({"PROPERTY","ANNOTATION"})
*/
final class JoinColumn extends Annotation {
/** @var string */
public $name;
/** @var string */
public $referencedColumnName = 'id';
/** @var boolean */
public $unique = false;
/** @var boolean */
public $nullable = true;
/** @var mixed */
public $onDelete;
/** @var string */
public $columnDefinition;
/** @var string */
public $fieldName; // field name used in non-object hydration (array/scalar)
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("PROPERTY")
*/
final class JoinColumns extends Annotation {
/** @var array<Doctrine\ORM\Mapping\JoinColumn> */
public $value;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("PROPERTY")
*/
final class Column extends Annotation {
/** @var string */
public $name;
/** @var mixed */
public $type = 'string';
/** @var integer */
public $length;
/** @var integer */
public $precision = 0; // The precision for a decimal (exact numeric) column (Applies only for decimal column)
/** @var integer */
public $scale = 0; // The scale for a decimal (exact numeric) column (Applies only for decimal column)
/** @var boolean */
public $unique = false;
/** @var boolean */
public $nullable = false;
/** @var array */
public $options = array();
/** @var string */
public $columnDefinition;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("PROPERTY")
*/
final class OneToOne extends Annotation {
/** @var string */
public $targetEntity;
/** @var string */
public $mappedBy;
/** @var string */
public $inversedBy;
/** @var array<string> */
public $cascade;
/** @var string */
public $fetch = 'LAZY';
/** @var boolean */
public $orphanRemoval = false;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("PROPERTY")
*/
final class OneToMany extends Annotation {
/** @var string */
public $mappedBy;
/** @var string */
public $targetEntity;
/** @var array<string> */
public $cascade;
/** @var string */
public $fetch = 'LAZY';
/** @var boolean */
public $orphanRemoval = false;
/** @var string */
public $indexBy;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("PROPERTY")
*/
final class ManyToOne extends Annotation {
/** @var string */
public $targetEntity;
/** @var array<string> */
public $cascade;
/** @var string */
public $fetch = 'LAZY';
/** @var string */
public $inversedBy;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("PROPERTY")
*/
final class ManyToMany extends Annotation {
/** @var string */
public $targetEntity;
/** @var string */
public $mappedBy;
/** @var string */
public $inversedBy;
/** @var array<string> */
public $cascade;
/** @var string */
public $fetch = 'LAZY';
/** @var string */
public $indexBy;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("ALL")
* @todo check available targets
*/
final class ElementCollection extends Annotation {
/** @var string */
public $tableName;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("CLASS")
*/
final class Table extends Annotation {
/** @var string */
public $name;
/** @var string */
public $schema;
/** @var array<Doctrine\ORM\Mapping\Index> */
2009-08-21 22:13:22 +04:00
public $indexes;
/** @var array<Doctrine\ORM\Mapping\UniqueConstraint> */
2009-08-21 22:13:22 +04:00
public $uniqueConstraints;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("ANNOTATION")
*/
2009-08-21 22:13:22 +04:00
final class UniqueConstraint extends Annotation {
/** @var string */
2009-08-21 22:13:22 +04:00
public $name;
/** @var array<string> */
2009-08-21 22:13:22 +04:00
public $columns;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("ANNOTATION")
*/
2009-08-21 22:13:22 +04:00
final class Index extends Annotation {
/** @var string */
2009-08-21 22:13:22 +04:00
public $name;
/** @var array<string> */
2009-08-21 22:13:22 +04:00
public $columns;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("PROPERTY")
*/
final class JoinTable extends Annotation {
/** @var string */
public $name;
/** @var string */
public $schema;
/** @var array<Doctrine\ORM\Mapping\JoinColumn> */
public $joinColumns = array();
/** @var array<Doctrine\ORM\Mapping\JoinColumn> */
public $inverseJoinColumns = array();
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("PROPERTY")
*/
final class SequenceGenerator extends Annotation {
/** @var string */
public $sequenceName;
/** @var integer */
public $allocationSize = 1;
/** @var integer */
public $initialValue = 1;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("CLASS")
*/
final class ChangeTrackingPolicy extends Annotation {
/** @var string */
public $value;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("PROPERTY")
*/
final class OrderBy extends Annotation {
/** @var array<string> */
public $value;
}
/**
* @Annotation
* @Target("CLASS")
*/
final class NamedQueries extends Annotation {
/** @var array<Doctrine\ORM\Mapping\NamedQuery> */
public $value;
}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("ANNOTATION")
*/
final class NamedQuery extends Annotation {
/** @var string */
public $name;
/** @var string */
public $query;
}
/* Annotations for lifecycle callbacks */
/**
* @Annotation
* @Target("CLASS")
*/
final class HasLifecycleCallbacks extends Annotation {}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("METHOD")
*/
final class PrePersist extends Annotation {}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("METHOD")
*/
final class PostPersist extends Annotation {}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("METHOD")
*/
final class PreUpdate extends Annotation {}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("METHOD")
*/
final class PostUpdate extends Annotation {}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("METHOD")
*/
final class PreRemove extends Annotation {}
2011-06-30 13:03:32 +04:00
/**
* @Annotation
* @Target("METHOD")
*/
final class PostRemove extends Annotation {}
/**
* @Annotation
* @Target("METHOD")
*/
2011-06-30 13:03:32 +04:00
final class PostLoad extends Annotation {}