Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / lib / Doctrine / ORM / Mapping / NamingStrategy.php
1 <?php
2
3 /*
4  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15  *
16  * This software consists of voluntary contributions made by many individuals
17  * and is licensed under the MIT license. For more information, see
18  * <http://www.doctrine-project.org>.
19  */
20
21 namespace Doctrine\ORM\Mapping;
22
23 /**
24  * A set of rules for determining the physical column and table names
25  *
26  * 
27  * @link    www.doctrine-project.org
28  * @since   2.3
29  * @author  Fabio B. Silva <fabio.bat.silva@gmail.com>
30  */
31 interface NamingStrategy
32 {
33     /**
34      * Return a table name for an entity class
35      *
36      * @param string $className The fully-qualified class name
37      * @return string A table name
38      */
39     function classToTableName($className);
40
41     /**
42      * Return a column name for a property
43      *
44      * @param string $propertyName A property
45      * @return string A column name
46      */
47     function propertyToColumnName($propertyName);
48
49     /**
50      * Return the default reference column name
51      *
52      * @return string A column name
53      */
54     function referenceColumnName();
55
56     /**
57      * Return a join column name for a property
58      *
59      * @param string $propertyName A property
60      * @return string A join column name
61      */
62     function joinColumnName($propertyName);
63
64     /**
65      * Return a join table name
66      *
67      * @param string $sourceEntity The source entity
68      * @param string $targetEntity The target entity
69      * @param string $propertyName A property
70      * @return string A join table name
71      */
72     function joinTableName($sourceEntity, $targetEntity, $propertyName = null);
73
74     /**
75      * Return the foreign key column name for the given parameters
76      *
77      * @param string $entityName A entity
78      * @param string $referencedColumnName A property
79      * @return string A join column name
80      */
81     function joinKeyColumnName($entityName, $referencedColumnName = null);
82 }