Merge remote branch 'dc2master/master'
This commit is contained in:
commit
9cee8bf890
14
build.xml
14
build.xml
@ -142,16 +142,16 @@
|
||||
|
||||
<nativephpunit testfile="./tests/Doctrine/Tests/ORM/Performance/AllTests.php" testdirectory="./tests" haltonfailure="false" haltonerror="false" />
|
||||
<tstamp/>
|
||||
<svnlastrevision svnpath="${svn.path}" workingcopy="." propertyname="svn.lastrevision"/>
|
||||
<copy file="${build.dir}/logs/testsuites.xml" tofile="${log.archive.dir}/${svn.lastrevision}/log.xml" overwrite="true"/>
|
||||
<!--<svnlastrevision svnpath="${svn.path}" workingcopy="." propertyname="svn.lastrevision"/>-->
|
||||
<copy file="${build.dir}/logs/testsuites.xml" tofile="${log.archive.dir}/latest/log.xml" overwrite="true"/>
|
||||
|
||||
<if><equals arg1="${test.pmd_reports}" arg2="1" />
|
||||
<then>
|
||||
<exec command="${test.pdepend_exec} --jdepend-xml=${build.dir}/logs/jdepend.xml ./lib/Doctrine" />
|
||||
<exec command="${test.phpmd_exec} ./lib/Doctrine xml codesize --reportfile ${build.dir}/logs/phpmd.xml" />
|
||||
|
||||
<copy file="${build.dir}/logs/jdepend.xml" tofile="${log.archive.dir}/${svn.lastrevision}/jdepend.xml" overwrite="true"/>
|
||||
<copy file="${build.dir}/logs/phpmd.xml" tofile="${log.archive.dir}/${svn.lastrevision}/phpmd.xml" overwrite="true"/>
|
||||
<copy file="${build.dir}/logs/jdepend.xml" tofile="${log.archive.dir}/latest/jdepend.xml" overwrite="true"/>
|
||||
<copy file="${build.dir}/logs/phpmd.xml" tofile="${log.archive.dir}/latest/phpmd.xml" overwrite="true"/>
|
||||
</then>
|
||||
</if>
|
||||
</target>
|
||||
@ -163,7 +163,7 @@
|
||||
<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/common/DoctrineCommon-${version}">
|
||||
<name>DoctrineCommon</name>
|
||||
<summary>Common Doctrine code</summary>
|
||||
<channel>pear.phpdoctrine.org</channel>
|
||||
<channel>pear.doctrine-project.org</channel>
|
||||
<description>The Doctrine Common package contains shared code between the other packages.</description>
|
||||
<lead user="jwage" name="Jonathan H. Wage" email="jonwage@gmail.com" />
|
||||
<lead user="guilhermeblanco" name="Guilherme Blanco" email="guilhermeblanco@gmail.com" />
|
||||
@ -182,7 +182,7 @@
|
||||
<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/dbal/DoctrineDBAL-${version}">
|
||||
<name>DoctrineDBAL</name>
|
||||
<summary>Doctrine Database Abstraction Layer</summary>
|
||||
<channel>pear.phpdoctrine.org</channel>
|
||||
<channel>pear.doctrine-project.org</channel>
|
||||
<description>The Doctrine DBAL package is the database abstraction layer used to power the ORM package.</description>
|
||||
<lead user="jwage" name="Jonathan H. Wage" email="jonwage@gmail.com" />
|
||||
<lead user="guilhermeblanco" name="Guilherme Blanco" email="guilhermeblanco@gmail.com" />
|
||||
@ -201,7 +201,7 @@
|
||||
<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/orm/DoctrineORM-${version}">
|
||||
<name>DoctrineORM</name>
|
||||
<summary>Doctrine Object Relationl Mapper</summary>
|
||||
<channel>pear.phpdoctrine.org</channel>
|
||||
<channel>pear.doctrine-project.org</channel>
|
||||
<description>The Doctrine ORM package is the primary package containing the object relational mapper.</description>
|
||||
<lead user="jwage" name="Jonathan H. Wage" email="jonwage@gmail.com" />
|
||||
<lead user="guilhermeblanco" name="Guilherme Blanco" email="guilhermeblanco@gmail.com" />
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -356,7 +356,8 @@ abstract class AssociationMapping
|
||||
$serialized = array(
|
||||
'sourceEntityName',
|
||||
'targetEntityName',
|
||||
'sourceFieldName'
|
||||
'sourceFieldName',
|
||||
'fetchMode'
|
||||
);
|
||||
|
||||
if ($this->isCascadeDetach) {
|
||||
|
@ -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.
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
namespace Doctrine\ORM\Mapping;
|
||||
|
||||
use ReflectionClass;
|
||||
|
||||
/**
|
||||
* A <tt>ClassMetadata</tt> 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.
|
||||
*
|
||||
|
@ -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(
|
||||
|
@ -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);
|
||||
|
@ -359,7 +359,7 @@ final class PersistentCollection implements Collection
|
||||
$this->_em->getUnitOfWork()->scheduleOrphanRemoval($removed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $removed;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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');
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user