-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
… to make parsing work.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?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 MIT license. For more information, see | ||
* <http://www.doctrine-project.org>. | ||
*/ | ||
|
||
namespace Doctrine\ORM\Mapping; | ||
|
||
/** | ||
* @Annotation | ||
* @Target("PROPERTY") | ||
*/ | ||
final class Embeddable implements Annotation | ||
{ | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?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 MIT license. For more information, see | ||
* <http://www.doctrine-project.org>. | ||
*/ | ||
|
||
namespace Doctrine\ORM\Mapping; | ||
|
||
/** | ||
* @Annotation | ||
* @Target("CLASS") | ||
*/ | ||
final class Embedded implements Annotation | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $class; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,37 @@ | |
|
||
namespace Doctrine\Tests\ORM\Functional; | ||
|
||
/** | ||
* @group DDC-93 | ||
*/ | ||
class ValueObjectsTest extends \Doctrine\Tests\OrmFunctionalTestCase | ||
{ | ||
public function setUp() | ||
{ | ||
parent::setUp(); | ||
|
||
$this->_schemaTool->createSchema(array( | ||
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC93Person'), | ||
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC93Address'), | ||
)); | ||
} | ||
|
||
public function testMetadata() | ||
{ | ||
$person = new DDC93Person(); | ||
$person->name = "Tara"; | ||
$person->address = new DDC93Address(); | ||
$person->address->street = "United States of Tara Street"; | ||
$person->address->zip = "12345"; | ||
$person->address->city = "funkytown"; | ||
|
||
$this->_em->persist($person); | ||
$this->_em->flush(); | ||
|
||
$this->_em->clear(); | ||
|
||
$person = $this->_em->find(DDC93Person::CLASSNAME, $person->id); | ||
$this->assertInstanceOf(DDC93Address::CLASSNAME, $person->address); | ||
} | ||
} | ||
|
||
|
@@ -14,12 +41,36 @@ public function setUp() | |
*/ | ||
class DDC93Person | ||
{ | ||
const CLASSNAME = __CLASS__; | ||
|
||
/** @Id @GeneratedValue @Column(type="integer") */ | ||
public $id; | ||
|
||
/** @Column(type="string") */ | ||
public $name; | ||
|
||
/** @Embedded */ | ||
/** @Embedded(class="DDC93Address") */ | ||
public $address; | ||
} | ||
|
||
/** | ||
* @Embeddable | ||
*/ | ||
class DDC93Address | ||
{ | ||
const CLASSNAME = __CLASS__; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
stof
Member
|
||
|
||
/** | ||
* @Column(type="string") | ||
*/ | ||
public $street; | ||
/** | ||
* @Column(type="string") | ||
*/ | ||
public $zip; | ||
/** | ||
* @Column(type="string") | ||
*/ | ||
public $city; | ||
} | ||
|
Why don't we raise the requirements and also drive up the php 5.5 adaption?