Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / lib / Doctrine / ORM / Mapping / QuoteStrategy.php
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 MIT license. For more information, see
17  * <http://www.doctrine-project.org>.
18  */
19
20 namespace Doctrine\ORM\Mapping;
21
22 use Doctrine\ORM\Mapping\ClassMetadata;
23 use Doctrine\DBAL\Platforms\AbstractPlatform;
24
25 /**
26  * A set of rules for determining the column, alias and table quotes
27  *
28  * @since   2.3
29  * @author  Fabio B. Silva <fabio.bat.silva@gmail.com>
30  */
31 interface QuoteStrategy
32 {
33     /**
34      * Gets the (possibly quoted) column name for safe use in an SQL statement.
35      *
36      * @param   string $fieldName
37      * @param   ClassMetadata $class
38      * @param   AbstractPlatform $platform
39      * @return  string
40      */
41     function getColumnName($fieldName, ClassMetadata $class, AbstractPlatform $platform);
42
43     /**
44      * Gets the (possibly quoted) primary table name for safe use in an SQL statement.
45      *
46      * @param   ClassMetadata $class
47      * @param   AbstractPlatform $platform
48      * @return  string
49      */
50     function getTableName(ClassMetadata $class, AbstractPlatform $platform);
51
52     /**
53      * Gets the (possibly quoted) sequence name for safe use in an SQL statement.
54      *
55      * @param   array $definition
56      * @param   ClassMetadata $class
57      * @param   AbstractPlatform $platform
58      * @return  string
59      */
60     function getSequenceName(array $definition, ClassMetadata $class, AbstractPlatform $platform);
61
62     /**
63      * Gets the (possibly quoted) name of the join table.
64      *
65      * @param   array $association
66      * @param   ClassMetadata $class
67      * @param   AbstractPlatform $platform
68      * @return  string
69      */
70     function getJoinTableName(array $association, ClassMetadata $class, AbstractPlatform $platform);
71
72     /**
73      * Gets the (possibly quoted) join column name.
74      *
75      * @param   array $joinColumn
76      * @param   ClassMetadata $class
77      * @param   AbstractPlatform $platform
78      * @return  string
79      */
80     function getJoinColumnName(array $joinColumn, ClassMetadata $class, AbstractPlatform $platform);
81
82     /**
83      * Gets the (possibly quoted) join column name.
84      *
85      * @param   array $joinColumn
86      * @param   ClassMetadata $class
87      * @param   AbstractPlatform $platform
88      * @return  string
89      */
90     function getReferencedJoinColumnName(array $joinColumn, ClassMetadata $class, AbstractPlatform $platform);
91
92     /**
93      * Gets the (possibly quoted) identifier column names for safe use in an SQL statement.
94      *
95      * @param   ClassMetadata $class
96      * @param   AbstractPlatform $platform
97      * @return  array
98      */
99     function getIdentifierColumnNames(ClassMetadata $class, AbstractPlatform $platform);
100
101     /**
102      * Gets the column alias.
103      *
104      * @param   string  $columnName
105      * @param   integer $counter
106      * @param   AbstractPlatform $platform
107      * @param   ClassMetadata $class
108      * @return  string
109      */
110     function getColumnAlias($columnName, $counter, AbstractPlatform $platform, ClassMetadata $class = null);
111
112 }