diff --git a/build.xml b/build.xml
index ca368eb5a..7665bdb63 100644
--- a/build.xml
+++ b/build.xml
@@ -142,16 +142,16 @@
-
-
+
+
-
-
+
+
@@ -163,7 +163,7 @@
DoctrineCommon
Common Doctrine code
- pear.phpdoctrine.org
+ pear.doctrine-project.org
The Doctrine Common package contains shared code between the other packages.
@@ -182,7 +182,7 @@
DoctrineDBAL
Doctrine Database Abstraction Layer
- pear.phpdoctrine.org
+ pear.doctrine-project.org
The Doctrine DBAL package is the database abstraction layer used to power the ORM package.
@@ -201,7 +201,7 @@
DoctrineORM
Doctrine Object Relationl Mapper
- pear.phpdoctrine.org
+ pear.doctrine-project.org
The Doctrine ORM package is the primary package containing the object relational mapper.
diff --git a/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php b/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
index 78b21796d..4ebdbec1c 100644
--- a/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
+++ b/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
@@ -60,6 +60,7 @@ class OCI8Statement implements \Doctrine\DBAL\Driver\Statement
* placeholders and converted to a named parameter.
*
* @param string $statement The SQL statement to convert.
+ * @todo review and test for lost spaces. we experienced missing spaces with oci8 in some sql statements.
*/
private function _convertPositionalToNamedPlaceholders($statement)
{
diff --git a/lib/Doctrine/ORM/Mapping/AssociationMapping.php b/lib/Doctrine/ORM/Mapping/AssociationMapping.php
index cadda07e3..488bcd0ff 100644
--- a/lib/Doctrine/ORM/Mapping/AssociationMapping.php
+++ b/lib/Doctrine/ORM/Mapping/AssociationMapping.php
@@ -356,7 +356,8 @@ abstract class AssociationMapping
$serialized = array(
'sourceEntityName',
'targetEntityName',
- 'sourceFieldName'
+ 'sourceFieldName',
+ 'fetchMode'
);
if ($this->isCascadeDetach) {
diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadata.php b/lib/Doctrine/ORM/Mapping/ClassMetadata.php
index a659e8235..48bbc996a 100644
--- a/lib/Doctrine/ORM/Mapping/ClassMetadata.php
+++ b/lib/Doctrine/ORM/Mapping/ClassMetadata.php
@@ -41,13 +41,6 @@ use ReflectionClass, ReflectionProperty;
*/
class ClassMetadata extends ClassMetadataInfo
{
- /**
- * The ReflectionClass instance of the mapped class.
- *
- * @var ReflectionClass
- */
- public $reflClass;
-
/**
* The ReflectionProperty instances of the mapped class.
*
@@ -76,16 +69,6 @@ class ClassMetadata extends ClassMetadataInfo
$this->table['name'] = $this->reflClass->getShortName();
}
- /**
- * Gets the ReflectionClass instance of the mapped class.
- *
- * @return ReflectionClass
- */
- public function getReflectionClass()
- {
- return $this->reflClass;
- }
-
/**
* Gets the ReflectionPropertys of the mapped class.
*
@@ -286,6 +269,7 @@ class ClassMetadata extends ClassMetadataInfo
'identifier',
'isIdentifierComposite', // TODO: REMOVE
'name',
+ 'namespace', // TODO: REMOVE
'table',
'rootEntityName',
'idGenerator', //TODO: Does not really need to be serialized. Could be moved to runtime.
diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
index ac481c48f..d1f13f002 100644
--- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
+++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
@@ -19,6 +19,8 @@
namespace Doctrine\ORM\Mapping;
+use ReflectionClass;
+
/**
* A ClassMetadata instance holds all the object-relational mapping metadata
* of an entity and it's associations.
@@ -366,6 +368,13 @@ class ClassMetadataInfo
*/
public $versionField;
+ /**
+ * The ReflectionClass instance of the mapped class.
+ *
+ * @var ReflectionClass
+ */
+ public $reflClass;
+
/**
* Initializes a new ClassMetadata instance that will hold the object-relational mapping
* metadata of the class with the given name.
@@ -378,6 +387,19 @@ class ClassMetadataInfo
$this->rootEntityName = $entityName;
}
+ /**
+ * Gets the ReflectionClass instance of the mapped class.
+ *
+ * @return ReflectionClass
+ */
+ public function getReflectionClass()
+ {
+ if ( ! $this->reflClass) {
+ $this->reflClass = new ReflectionClass($entityName);
+ }
+ return $this->reflClass;
+ }
+
/**
* Sets the change tracking policy used by this class.
*
diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
index ec3d92f7b..e44af01cf 100644
--- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
+++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
@@ -143,7 +143,7 @@ class AnnotationDriver implements Driver
throw MappingException::classIsNotAValidEntityOrMappedSuperClass($className);
}
- // Evaluate DoctrineTable annotation
+ // Evaluate Table annotation
if (isset($classAnnotations['Doctrine\ORM\Mapping\Table'])) {
$tableAnnot = $classAnnotations['Doctrine\ORM\Mapping\Table'];
$primaryTable = array(
diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
index fd06dd07c..5eaa8897e 100644
--- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
+++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
@@ -205,9 +205,9 @@ class XmlDriver extends AbstractFileDriver
if (isset($idElement->{'sequence-generator'})) {
$seqGenerator = $idElement->{'sequence-generator'};
$metadata->setSequenceGeneratorDefinition(array(
- 'sequenceName' => $seqGenerator->{'sequence-name'},
- 'allocationSize' => $seqGenerator->{'allocation-size'},
- 'initialValue' => $seqGeneratorAnnot->{'initial-value'}
+ 'sequenceName' => (string)$seqGenerator['sequence-name'],
+ 'allocationSize' => (string)$seqGenerator['allocation-size'],
+ 'initialValue' => (string)$seqGeneratorAnnot['initial-value']
));
} else if (isset($idElement->{'table-generator'})) {
throw MappingException::tableIdGeneratorNotImplemented($className);
diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php
index 81d9a3e07..afbbf361f 100644
--- a/lib/Doctrine/ORM/PersistentCollection.php
+++ b/lib/Doctrine/ORM/PersistentCollection.php
@@ -359,7 +359,7 @@ final class PersistentCollection implements Collection
$this->_em->getUnitOfWork()->scheduleOrphanRemoval($removed);
}
}
-
+
return $removed;
}
diff --git a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php
index 9b8609850..54c7e5195 100644
--- a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php
+++ b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php
@@ -815,7 +815,7 @@ class BasicEntityPersister
: $baseTableAlias;
$columnName = $this->_class->getQuotedColumnName($fieldName, $this->_platform);
- $orderBySql .= $orderBySql ? ', ' : 'ORDER BY ';
+ $orderBySql .= $orderBySql ? ', ' : ' ORDER BY ';
$orderBySql .= $tableAlias . '.' . $columnName . ' ' . $orientation;
}
diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php
index 366e14de8..23466a1b9 100644
--- a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php
+++ b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php
@@ -53,7 +53,7 @@ class XmlExporter extends AbstractExporter
$xml->addAttribute('xmlns', 'http://doctrine-project.org/schemas/orm/doctrine-mapping');
$xml->addAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
- $xml->addAttribute('xsi:schemaLocation', 'http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd');
+ $xml->addAttribute('xsi:schemaLocation', 'http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd');
if ($metadata->isMappedSuperclass) {
$root = $xml->addChild('mapped-superclass');
diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php
index 92231ae8e..96fc026f7 100644
--- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php
+++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php
@@ -37,6 +37,7 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase
// Check state
$this->assertTrue(count($cm->getReflectionProperties()) > 0);
+ $this->assertEquals('Doctrine\Tests\Models\CMS', $cm->namespace);
$this->assertTrue($cm->reflClass instanceof \ReflectionClass);
$this->assertEquals('Doctrine\Tests\Models\CMS\CmsUser', $cm->name);
$this->assertEquals('UserParent', $cm->rootEntityName);
@@ -47,6 +48,7 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase
$this->assertTrue($cm->getAssociationMapping('phonenumbers') instanceof \Doctrine\ORM\Mapping\OneToOneMapping);
$this->assertEquals(1, count($cm->associationMappings));
$oneOneMapping = $cm->getAssociationMapping('phonenumbers');
+ $this->assertTrue($oneOneMapping->fetchMode == \Doctrine\ORM\Mapping\AssociationMapping::FETCH_LAZY);
$this->assertEquals('phonenumbers', $oneOneMapping->sourceFieldName);
$this->assertEquals('Doctrine\Tests\Models\CMS\Bar', $oneOneMapping->targetEntityName);
}