Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tests / Doctrine / Tests / Models / DDC1476 / DDC1476EntityWithDefaultFieldType.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 LGPL. For more information, see
18  * <http://www.doctrine-project.org>.
19  */
20
21 namespace Doctrine\Tests\Models\DDC1476;
22
23 /**
24  * @Entity()
25  */
26 class DDC1476EntityWithDefaultFieldType
27 {
28
29     /**
30      * @Id
31      * @Column()
32      * @GeneratedValue("NONE")
33      */
34     protected $id;
35
36     /** @column() */
37     protected $name;
38
39     /**
40      * @return integer
41      */
42     public function getId()
43     {
44         return $this->id;
45     }
46
47     /**
48      * @return string
49      */
50     public function getName()
51     {
52         return $this->name;
53     }
54
55     /**
56      * @param string $name
57      */
58     public function setName($name)
59     {
60         $this->name = $name;
61     }
62
63     public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata)
64     {
65         $metadata->mapField(array(
66            'id'         => true,
67            'fieldName'  => 'id',
68         ));
69         $metadata->mapField(array(
70            'fieldName'  => 'name',
71         ));
72
73         $metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadataInfo::GENERATOR_TYPE_NONE);
74     }
75
76 }