Commit 96ef7eca authored by romanb's avatar romanb

[2.0] More small internal perf. improvements.

parent eea43915
...@@ -39,7 +39,7 @@ use \PDO; ...@@ -39,7 +39,7 @@ use \PDO;
abstract class AbstractHydrator abstract class AbstractHydrator
{ {
/** The ResultSetMapping. */ /** The ResultSetMapping. */
protected $_resultSetMapping; protected $_rsm;
/** @var EntityManager The EntityManager instance. */ /** @var EntityManager The EntityManager instance. */
protected $_em; protected $_em;
...@@ -74,7 +74,7 @@ abstract class AbstractHydrator ...@@ -74,7 +74,7 @@ abstract class AbstractHydrator
public function iterate($stmt, $resultSetMapping) public function iterate($stmt, $resultSetMapping)
{ {
$this->_stmt = $stmt; $this->_stmt = $stmt;
$this->_resultSetMapping = $resultSetMapping; $this->_rsm = $resultSetMapping;
$this->_prepare(); $this->_prepare();
return new IterableResult($this); return new IterableResult($this);
} }
...@@ -89,7 +89,7 @@ abstract class AbstractHydrator ...@@ -89,7 +89,7 @@ abstract class AbstractHydrator
public function hydrateAll($stmt, $resultSetMapping) public function hydrateAll($stmt, $resultSetMapping)
{ {
$this->_stmt = $stmt; $this->_stmt = $stmt;
$this->_resultSetMapping = $resultSetMapping; $this->_rsm = $resultSetMapping;
$this->_prepare(); $this->_prepare();
$result = $this->_hydrateAll(); $result = $this->_hydrateAll();
$this->_cleanup(); $this->_cleanup();
...@@ -127,7 +127,7 @@ abstract class AbstractHydrator ...@@ -127,7 +127,7 @@ abstract class AbstractHydrator
*/ */
protected function _cleanup() protected function _cleanup()
{ {
$this->_resultSetMapping = null; $this->_rsm = null;
$this->_stmt->closeCursor(); $this->_stmt->closeCursor();
$this->_stmt = null; $this->_stmt = null;
} }
...@@ -174,26 +174,26 @@ abstract class AbstractHydrator ...@@ -174,26 +174,26 @@ abstract class AbstractHydrator
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
// Parse each column name only once. Cache the results. // Parse each column name only once. Cache the results.
if ( ! isset($cache[$key])) { if ( ! isset($cache[$key])) {
if (isset($this->_resultSetMapping->ignoredColumns[$key])) { if (isset($this->_rsm->ignoredColumns[$key])) {
$cache[$key] = false; $cache[$key] = false;
} else if (isset($this->_resultSetMapping->scalarMappings[$key])) { } else if (isset($this->_rsm->scalarMappings[$key])) {
$cache[$key]['fieldName'] = $this->_resultSetMapping->getScalarAlias($key); $cache[$key]['fieldName'] = $this->_rsm->getScalarAlias($key);
$cache[$key]['isScalar'] = true; $cache[$key]['isScalar'] = true;
} else if (isset($this->_resultSetMapping->fieldMappings[$key])) { } else if (isset($this->_rsm->fieldMappings[$key])) {
$classMetadata = $this->_resultSetMapping->getOwningClass($key); $classMetadata = $this->_rsm->getOwningClass($key);
$fieldName = $this->_resultSetMapping->fieldMappings[$key]; $fieldName = $this->_rsm->fieldMappings[$key];
$classMetadata = $this->_lookupDeclaringClass($classMetadata, $fieldName); $classMetadata = $this->_lookupDeclaringClass($classMetadata, $fieldName);
$cache[$key]['fieldName'] = $fieldName; $cache[$key]['fieldName'] = $fieldName;
$cache[$key]['isScalar'] = false; $cache[$key]['isScalar'] = false;
$cache[$key]['type'] = Type::getType($classMetadata->getTypeOfField($fieldName)); $cache[$key]['type'] = Type::getType($classMetadata->getTypeOfField($fieldName));
$cache[$key]['isIdentifier'] = $classMetadata->isIdentifier($fieldName); $cache[$key]['isIdentifier'] = $classMetadata->isIdentifier($fieldName);
$cache[$key]['dqlAlias'] = $this->_resultSetMapping->columnOwnerMap[$key]; $cache[$key]['dqlAlias'] = $this->_rsm->columnOwnerMap[$key];
} else { } else {
// Discriminator column // Discriminator column
$cache[$key]['isDiscriminator'] = true; $cache[$key]['isDiscriminator'] = true;
$cache[$key]['isScalar'] = false; $cache[$key]['isScalar'] = false;
$cache[$key]['fieldName'] = $key; $cache[$key]['fieldName'] = $key;
$cache[$key]['dqlAlias'] = $this->_resultSetMapping->columnOwnerMap[$key]; $cache[$key]['dqlAlias'] = $this->_rsm->columnOwnerMap[$key];
} }
} }
...@@ -245,20 +245,20 @@ abstract class AbstractHydrator ...@@ -245,20 +245,20 @@ abstract class AbstractHydrator
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
// Parse each column name only once. Cache the results. // Parse each column name only once. Cache the results.
if ( ! isset($cache[$key])) { if ( ! isset($cache[$key])) {
if (isset($this->_resultSetMapping->ignoredColumns[$key])) { if (isset($this->_rsm->ignoredColumns[$key])) {
$cache[$key] = false; $cache[$key] = false;
continue; continue;
} else if (isset($this->_resultSetMapping->scalarMappings[$key])) { } else if (isset($this->_rsm->scalarMappings[$key])) {
$cache[$key]['fieldName'] = $this->_resultSetMapping->scalarMappings[$key]; $cache[$key]['fieldName'] = $this->_rsm->scalarMappings[$key];
$cache[$key]['isScalar'] = true; $cache[$key]['isScalar'] = true;
} else { } else {
$classMetadata = $this->_resultSetMapping->getOwningClass($key); $classMetadata = $this->_rsm->getOwningClass($key);
$fieldName = $this->_resultSetMapping->fieldMappings[$key]; $fieldName = $this->_rsm->fieldMappings[$key];
$classMetadata = $this->_lookupDeclaringClass($classMetadata, $fieldName); $classMetadata = $this->_lookupDeclaringClass($classMetadata, $fieldName);
$cache[$key]['fieldName'] = $fieldName; $cache[$key]['fieldName'] = $fieldName;
$cache[$key]['isScalar'] = false; $cache[$key]['isScalar'] = false;
$cache[$key]['type'] = Type::getType($classMetadata->getTypeOfField($fieldName)); $cache[$key]['type'] = Type::getType($classMetadata->getTypeOfField($fieldName));
$cache[$key]['dqlAlias'] = $this->_resultSetMapping->columnOwnerMap[$key]; $cache[$key]['dqlAlias'] = $this->_rsm->columnOwnerMap[$key];
} }
} }
...@@ -283,8 +283,8 @@ abstract class AbstractHydrator ...@@ -283,8 +283,8 @@ abstract class AbstractHydrator
*/ */
protected function _getCustomIndexField($alias) protected function _getCustomIndexField($alias)
{ {
return isset($this->_resultSetMapping->indexByMap[$alias]) ? return isset($this->_rsm->indexByMap[$alias]) ?
$this->_resultSetMapping->indexByMap[$alias] : null; $this->_rsm->indexByMap[$alias] : null;
} }
/** /**
......
...@@ -40,12 +40,12 @@ class ArrayHydrator extends AbstractHydrator ...@@ -40,12 +40,12 @@ class ArrayHydrator extends AbstractHydrator
/** @override */ /** @override */
protected function _prepare() protected function _prepare()
{ {
$this->_isSimpleQuery = $this->_resultSetMapping->getEntityResultCount() <= 1; $this->_isSimpleQuery = $this->_rsm->getEntityResultCount() <= 1;
$this->_identifierMap = array(); $this->_identifierMap = array();
$this->_resultPointers = array(); $this->_resultPointers = array();
$this->_idTemplate = array(); $this->_idTemplate = array();
$this->_resultCounter = 0; $this->_resultCounter = 0;
foreach ($this->_resultSetMapping->getAliasMap() as $dqlAlias => $class) { foreach ($this->_rsm->getAliasMap() as $dqlAlias => $class) {
$this->_identifierMap[$dqlAlias] = array(); $this->_identifierMap[$dqlAlias] = array();
$this->_resultPointers[$dqlAlias] = array(); $this->_resultPointers[$dqlAlias] = array();
$this->_idTemplate[$dqlAlias] = ''; $this->_idTemplate[$dqlAlias] = '';
...@@ -88,17 +88,17 @@ class ArrayHydrator extends AbstractHydrator ...@@ -88,17 +88,17 @@ class ArrayHydrator extends AbstractHydrator
foreach ($rowData as $dqlAlias => $data) { foreach ($rowData as $dqlAlias => $data) {
$index = false; $index = false;
if (isset($this->_resultSetMapping->parentAliasMap[$dqlAlias])) { if (isset($this->_rsm->parentAliasMap[$dqlAlias])) {
// It's a joined result // It's a joined result
$parent = $this->_resultSetMapping->parentAliasMap[$dqlAlias]; $parent = $this->_rsm->parentAliasMap[$dqlAlias];
$relation = $this->_resultSetMapping->relationMap[$dqlAlias]; $relation = $this->_rsm->relationMap[$dqlAlias];
$relationAlias = $relation->getSourceFieldName(); $relationAlias = $relation->getSourceFieldName();
$path = $parent . '.' . $dqlAlias; $path = $parent . '.' . $dqlAlias;
// Get a reference to the right element in the result tree. // Get a reference to the right element in the result tree.
// This element will get the associated element attached. // This element will get the associated element attached.
if ($this->_resultSetMapping->isMixed && isset($this->_rootAliases[$parent])) { if ($this->_rsm->isMixed && isset($this->_rootAliases[$parent])) {
$key = key(reset($this->_resultPointers)); $key = key(reset($this->_resultPointers));
// TODO: Exception if $key === null ? // TODO: Exception if $key === null ?
$baseElement =& $this->_resultPointers[$parent][$key]; $baseElement =& $this->_resultPointers[$parent][$key];
...@@ -155,14 +155,14 @@ class ArrayHydrator extends AbstractHydrator ...@@ -155,14 +155,14 @@ class ArrayHydrator extends AbstractHydrator
if ($this->_isSimpleQuery || ! isset($this->_identifierMap[$dqlAlias][$id[$dqlAlias]])) { if ($this->_isSimpleQuery || ! isset($this->_identifierMap[$dqlAlias][$id[$dqlAlias]])) {
$element = $rowData[$dqlAlias]; $element = $rowData[$dqlAlias];
if ($field = $this->_getCustomIndexField($dqlAlias)) { if ($field = $this->_getCustomIndexField($dqlAlias)) {
if ($this->_resultSetMapping->isMixed) { if ($this->_rsm->isMixed) {
$result[] = array($element[$field] => $element); $result[] = array($element[$field] => $element);
++$this->_resultCounter; ++$this->_resultCounter;
} else { } else {
$result[$element[$field]] = $element; $result[$element[$field]] = $element;
} }
} else { } else {
if ($this->_resultSetMapping->isMixed) { if ($this->_rsm->isMixed) {
$result[] = array($element); $result[] = array($element);
++$this->_resultCounter; ++$this->_resultCounter;
} else { } else {
......
<?php <?php
/* /*
* To change this template, choose Tools | Templates * $Id$
* and open the template in the editor. *
* 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 LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/ */
namespace Doctrine\ORM\Internal\Hydration; namespace Doctrine\ORM\Internal\Hydration;
...@@ -11,7 +26,7 @@ use \PDO; ...@@ -11,7 +26,7 @@ use \PDO;
/** /**
* Description of SingleScalarHydrator * Description of SingleScalarHydrator
* *
* @author robo * @author Roman Borschel <roman@code-factory.org>
*/ */
class SingleScalarHydrator extends AbstractHydrator class SingleScalarHydrator extends AbstractHydrator
{ {
......
...@@ -24,6 +24,14 @@ namespace Doctrine\ORM\Mapping; ...@@ -24,6 +24,14 @@ namespace Doctrine\ORM\Mapping;
/** /**
* Base class for association mappings. * Base class for association mappings.
* *
* <b>IMPORTANT NOTE:</b>
*
* The fields of this class are only public for 2 reasons:
* 1) To allow fast, internal READ access.
* 2) To drastically reduce the size of a serialized instance (private/protected members
* get the whole class name, namespace inclusive, prepended to every property in
* the serialized representation).
*
* @author Roman Borschel <roman@code-factory.org> * @author Roman Borschel <roman@code-factory.org>
* @since 2.0 * @since 2.0
*/ */
...@@ -47,18 +55,18 @@ abstract class AssociationMapping ...@@ -47,18 +55,18 @@ abstract class AssociationMapping
'merge' 'merge'
); );
protected $_cascades = array(); public $cascades = array();
protected $_isCascadeDelete; public $isCascadeDelete;
protected $_isCascadeSave; public $isCascadeSave;
protected $_isCascadeRefresh; public $isCascadeRefresh;
protected $_isCascadeMerge; public $isCascadeMerge;
/** /**
* The fetch mode used for the association. * The fetch mode used for the association.
* *
* @var integer * @var integer
*/ */
protected $_fetchMode = self::FETCH_MANUAL; public $fetchMode = self::FETCH_MANUAL;
/** /**
* Flag that indicates whether the class that defines this mapping is * Flag that indicates whether the class that defines this mapping is
...@@ -66,7 +74,7 @@ abstract class AssociationMapping ...@@ -66,7 +74,7 @@ abstract class AssociationMapping
* *
* @var boolean * @var boolean
*/ */
protected $_isOwningSide = true; public $isOwningSide = true;
/** /**
* Whether the association is optional (0..X) or not (1..X). * Whether the association is optional (0..X) or not (1..X).
...@@ -74,14 +82,14 @@ abstract class AssociationMapping ...@@ -74,14 +82,14 @@ abstract class AssociationMapping
* *
* @var boolean * @var boolean
*/ */
protected $_isOptional = true; public $isOptional = true;
/** /**
* The name of the source Entity (the Entity that defines this mapping). * The name of the source Entity (the Entity that defines this mapping).
* *
* @var string * @var string
*/ */
protected $_sourceEntityName; public $sourceEntityName;
/** /**
* The name of the target Entity (the Enitity that is the target of the * The name of the target Entity (the Enitity that is the target of the
...@@ -89,7 +97,7 @@ abstract class AssociationMapping ...@@ -89,7 +97,7 @@ abstract class AssociationMapping
* *
* @var string * @var string
*/ */
protected $_targetEntityName; public $targetEntityName;
/** /**
* Identifies the field on the source class (the class this AssociationMapping * Identifies the field on the source class (the class this AssociationMapping
...@@ -98,7 +106,7 @@ abstract class AssociationMapping ...@@ -98,7 +106,7 @@ abstract class AssociationMapping
* *
* @var string * @var string
*/ */
protected $_sourceFieldName; public $sourceFieldName;
/** /**
* Identifies the field on the owning side that controls the mapping for the * Identifies the field on the owning side that controls the mapping for the
...@@ -106,14 +114,14 @@ abstract class AssociationMapping ...@@ -106,14 +114,14 @@ abstract class AssociationMapping
* *
* @var string * @var string
*/ */
protected $_mappedByFieldName; public $mappedByFieldName;
/** /**
* The join table definition, if any. * The join table definition, if any.
* *
* @var array * @var array
*/ */
protected $_joinTable = array(); public $joinTable = array();
//protected $_joinTableInsertSql; //protected $_joinTableInsertSql;
...@@ -138,34 +146,38 @@ abstract class AssociationMapping ...@@ -138,34 +146,38 @@ abstract class AssociationMapping
if ( ! isset($mapping['fieldName'])) { if ( ! isset($mapping['fieldName'])) {
throw MappingException::missingFieldName(); throw MappingException::missingFieldName();
} }
$this->_sourceFieldName = $mapping['fieldName']; $this->sourceFieldName = $mapping['fieldName'];
if ( ! isset($mapping['sourceEntity'])) { if ( ! isset($mapping['sourceEntity'])) {
throw MappingException::missingSourceEntity($mapping['fieldName']); throw MappingException::missingSourceEntity($mapping['fieldName']);
} }
$this->_sourceEntityName = $mapping['sourceEntity']; $this->sourceEntityName = $mapping['sourceEntity'];
if ( ! isset($mapping['targetEntity'])) { if ( ! isset($mapping['targetEntity'])) {
throw MappingException::missingTargetEntity($mapping['fieldName']); throw MappingException::missingTargetEntity($mapping['fieldName']);
} }
$this->_targetEntityName = $mapping['targetEntity']; $this->targetEntityName = $mapping['targetEntity'];
// Mandatory and optional attributes for either side // Mandatory and optional attributes for either side
if ( ! isset($mapping['mappedBy'])) { if ( ! isset($mapping['mappedBy'])) {
// Optional // Optional
if (isset($mapping['joinTable'])) { if (isset($mapping['joinTable'])) {
$this->_joinTable = $mapping['joinTable']; $this->joinTable = $mapping['joinTable'];
} }
} else { } else {
$this->_isOwningSide = false; $this->isOwningSide = false;
$this->_mappedByFieldName = $mapping['mappedBy']; $this->mappedByFieldName = $mapping['mappedBy'];
} }
// Optional attributes for both sides // Optional attributes for both sides
$this->_isOptional = isset($mapping['optional']) ? $this->isOptional = isset($mapping['optional']) ?
(bool)$mapping['optional'] : true; (bool)$mapping['optional'] : true;
$this->_cascades = isset($mapping['cascade']) ? $this->cascades = isset($mapping['cascade']) ?
(array)$mapping['cascade'] : array(); (array)$mapping['cascade'] : array();
$this->isCascadeDelete = in_array('delete', $this->cascades);
$this->isCascadeSave = in_array('save', $this->cascades);
$this->isCascadeRefresh = in_array('refresh', $this->cascades);
$this->isCascadeMerge = in_array('merge', $this->cascades);
} }
/** /**
...@@ -176,10 +188,7 @@ abstract class AssociationMapping ...@@ -176,10 +188,7 @@ abstract class AssociationMapping
*/ */
public function isCascadeDelete() public function isCascadeDelete()
{ {
if ($this->_isCascadeDelete === null) { return $this->isCascadeDelete;
$this->_isCascadeDelete = in_array('delete', $this->_cascades);
}
return $this->_isCascadeDelete;
} }
/** /**
...@@ -190,10 +199,7 @@ abstract class AssociationMapping ...@@ -190,10 +199,7 @@ abstract class AssociationMapping
*/ */
public function isCascadeSave() public function isCascadeSave()
{ {
if ($this->_isCascadeSave === null) { return $this->isCascadeSave;
$this->_isCascadeSave = in_array('save', $this->_cascades);
}
return $this->_isCascadeSave;
} }
/** /**
...@@ -204,10 +210,7 @@ abstract class AssociationMapping ...@@ -204,10 +210,7 @@ abstract class AssociationMapping
*/ */
public function isCascadeRefresh() public function isCascadeRefresh()
{ {
if ($this->_isCascadeRefresh === null) { return $this->isCascadeRefresh;
$this->_isCascadeRefresh = in_array('refresh', $this->_cascades);
}
return $this->_isCascadeRefresh;
} }
/** /**
...@@ -218,10 +221,7 @@ abstract class AssociationMapping ...@@ -218,10 +221,7 @@ abstract class AssociationMapping
*/ */
public function isCascadeMerge() public function isCascadeMerge()
{ {
if ($this->_isCascadeMerge === null) { return $this->isCascadeMerge;
$this->_isCascadeMerge = in_array('merge', $this->_cascades);
}
return $this->_isCascadeMerge;
} }
/** /**
...@@ -231,7 +231,7 @@ abstract class AssociationMapping ...@@ -231,7 +231,7 @@ abstract class AssociationMapping
*/ */
public function isEagerlyFetched() public function isEagerlyFetched()
{ {
return $this->_fetchMode == self::FETCH_EAGER; return $this->fetchMode == self::FETCH_EAGER;
} }
/** /**
...@@ -241,7 +241,7 @@ abstract class AssociationMapping ...@@ -241,7 +241,7 @@ abstract class AssociationMapping
*/ */
public function isLazilyFetched() public function isLazilyFetched()
{ {
return $this->_fetchMode == self::FETCH_LAZY; return $this->fetchMode == self::FETCH_LAZY;
} }
/** /**
...@@ -251,7 +251,7 @@ abstract class AssociationMapping ...@@ -251,7 +251,7 @@ abstract class AssociationMapping
*/ */
public function isManuallyFetched() public function isManuallyFetched()
{ {
return $this->_fetchMode == self::FETCH_MANUAL; return $this->fetchMode == self::FETCH_MANUAL;
} }
/** /**
...@@ -261,7 +261,7 @@ abstract class AssociationMapping ...@@ -261,7 +261,7 @@ abstract class AssociationMapping
*/ */
public function isOwningSide() public function isOwningSide()
{ {
return $this->_isOwningSide; return $this->isOwningSide;
} }
/** /**
...@@ -271,7 +271,7 @@ abstract class AssociationMapping ...@@ -271,7 +271,7 @@ abstract class AssociationMapping
*/ */
public function isInverseSide() public function isInverseSide()
{ {
return ! $this->_isOwningSide; return ! $this->isOwningSide;
} }
/** /**
...@@ -282,7 +282,7 @@ abstract class AssociationMapping ...@@ -282,7 +282,7 @@ abstract class AssociationMapping
*/ */
public function isOptional() public function isOptional()
{ {
return $this->_isOptional; return $this->isOptional;
} }
/** /**
...@@ -292,7 +292,7 @@ abstract class AssociationMapping ...@@ -292,7 +292,7 @@ abstract class AssociationMapping
*/ */
public function getSourceEntityName() public function getSourceEntityName()
{ {
return $this->_sourceEntityName; return $this->sourceEntityName;
} }
/** /**
...@@ -302,7 +302,7 @@ abstract class AssociationMapping ...@@ -302,7 +302,7 @@ abstract class AssociationMapping
*/ */
public function getTargetEntityName() public function getTargetEntityName()
{ {
return $this->_targetEntityName; return $this->targetEntityName;
} }
/** /**
...@@ -312,7 +312,7 @@ abstract class AssociationMapping ...@@ -312,7 +312,7 @@ abstract class AssociationMapping
*/ */
public function getJoinTable() public function getJoinTable()
{ {
return $this->_joinTable; return $this->joinTable;
} }
/** /**
...@@ -322,7 +322,7 @@ abstract class AssociationMapping ...@@ -322,7 +322,7 @@ abstract class AssociationMapping
*/ */
public function getSourceFieldName() public function getSourceFieldName()
{ {
return $this->_sourceFieldName; return $this->sourceFieldName;
} }
/** /**
...@@ -334,7 +334,7 @@ abstract class AssociationMapping ...@@ -334,7 +334,7 @@ abstract class AssociationMapping
*/ */
public function getMappedByFieldName() public function getMappedByFieldName()
{ {
return $this->_mappedByFieldName; return $this->mappedByFieldName;
} }
/** /**
...@@ -374,7 +374,7 @@ abstract class AssociationMapping ...@@ -374,7 +374,7 @@ abstract class AssociationMapping
*/ */
public function usesJoinTable() public function usesJoinTable()
{ {
return (bool)$this->_joinTable; return (bool)$this->joinTable;
} }
/** /**
......
...@@ -36,8 +36,6 @@ use Doctrine\Common\DoctrineException; ...@@ -36,8 +36,6 @@ use Doctrine\Common\DoctrineException;
* get the whole class name, namespace inclusive, prepended to every property in * get the whole class name, namespace inclusive, prepended to every property in
* the serialized representation). * the serialized representation).
* *
* !! Do NOT write/modify the public properties directly. Go through the public API. !!
*
* @author Roman Borschel <roman@code-factory.org> * @author Roman Borschel <roman@code-factory.org>
* @since 2.0 * @since 2.0
*/ */
......
...@@ -25,6 +25,14 @@ namespace Doctrine\ORM\Mapping; ...@@ -25,6 +25,14 @@ namespace Doctrine\ORM\Mapping;
* A many-to-many mapping describes the mapping between two collections of * A many-to-many mapping describes the mapping between two collections of
* entities. * entities.
* *
* <b>IMPORTANT NOTE:</b>
*
* The fields of this class are only public for 2 reasons:
* 1) To allow fast, internal READ access.
* 2) To drastically reduce the size of a serialized instance (private/protected members
* get the whole class name, namespace inclusive, prepended to every property in
* the serialized representation).
*
* @since 2.0 * @since 2.0
* @author Roman Borschel <roman@code-factory.org> * @author Roman Borschel <roman@code-factory.org>
*/ */
...@@ -33,27 +41,27 @@ class ManyToManyMapping extends AssociationMapping ...@@ -33,27 +41,27 @@ class ManyToManyMapping extends AssociationMapping
/** /**
* The key columns of the source table. * The key columns of the source table.
*/ */
private $_sourceKeyColumns = array(); public $sourceKeyColumns = array();
/** /**
* The key columns of the target table. * The key columns of the target table.
*/ */
private $_targetKeyColumns = array(); public $targetKeyColumns = array();
/** /**
* Maps the columns in the source table to the columns in the relation table. * Maps the columns in the source table to the columns in the relation table.
*/ */
private $_sourceToRelationKeyColumns = array(); public $sourceToRelationKeyColumns = array();
/** /**
* Maps the columns in the target table to the columns in the relation table. * Maps the columns in the target table to the columns in the relation table.
*/ */
private $_targetToRelationKeyColumns = array(); public $targetToRelationKeyColumns = array();
/** /**
* The columns on the join table. * The columns on the join table.
*/ */
private $_joinTableColumns = array(); public $joinTableColumns = array();
/** /**
* Initializes a new ManyToManyMapping. * Initializes a new ManyToManyMapping.
...@@ -85,46 +93,46 @@ class ManyToManyMapping extends AssociationMapping ...@@ -85,46 +93,46 @@ class ManyToManyMapping extends AssociationMapping
throw MappingException::invalidMapping($this->_sourceFieldName); throw MappingException::invalidMapping($this->_sourceFieldName);
} }
foreach ($mapping['joinTable']['joinColumns'] as $joinColumn) { foreach ($mapping['joinTable']['joinColumns'] as $joinColumn) {
$this->_sourceToRelationKeyColumns[$joinColumn['referencedColumnName']] = $joinColumn['name']; $this->sourceToRelationKeyColumns[$joinColumn['referencedColumnName']] = $joinColumn['name'];
$this->_joinTableColumns[] = $joinColumn['name']; $this->joinTableColumns[] = $joinColumn['name'];
} }
$this->_sourceKeyColumns = array_keys($this->_sourceToRelationKeyColumns); $this->sourceKeyColumns = array_keys($this->sourceToRelationKeyColumns);
// owning side MUST specify inverseJoinColumns // owning side MUST specify inverseJoinColumns
if ( ! isset($mapping['joinTable']['inverseJoinColumns'])) { if ( ! isset($mapping['joinTable']['inverseJoinColumns'])) {
throw MappingException::invalidMapping($this->_sourceFieldName); throw MappingException::invalidMapping($this->_sourceFieldName);
} }
foreach ($mapping['joinTable']['inverseJoinColumns'] as $inverseJoinColumn) { foreach ($mapping['joinTable']['inverseJoinColumns'] as $inverseJoinColumn) {
$this->_targetToRelationKeyColumns[$inverseJoinColumn['referencedColumnName']] = $inverseJoinColumn['name']; $this->targetToRelationKeyColumns[$inverseJoinColumn['referencedColumnName']] = $inverseJoinColumn['name'];
$this->_joinTableColumns[] = $inverseJoinColumn['name']; $this->joinTableColumns[] = $inverseJoinColumn['name'];
} }
$this->_targetKeyColumns = array_keys($this->_targetToRelationKeyColumns); $this->targetKeyColumns = array_keys($this->targetToRelationKeyColumns);
} }
} }
public function getJoinTableColumns() public function getJoinTableColumns()
{ {
return $this->_joinTableColumns; return $this->joinTableColumns;
} }
public function getSourceToRelationKeyColumns() public function getSourceToRelationKeyColumns()
{ {
return $this->_sourceToRelationKeyColumns; return $this->sourceToRelationKeyColumns;
} }
public function getTargetToRelationKeyColumns() public function getTargetToRelationKeyColumns()
{ {
return $this->_targetToRelationKeyColumns; return $this->targetToRelationKeyColumns;
} }
public function getSourceKeyColumns() public function getSourceKeyColumns()
{ {
return $this->_sourceKeyColumns; return $this->sourceKeyColumns;
} }
public function getTargetKeyColumns() public function getTargetKeyColumns()
{ {
return $this->_targetKeyColumns; return $this->targetKeyColumns;
} }
public function lazyLoadFor($entity, $entityManager) public function lazyLoadFor($entity, $entityManager)
......
...@@ -29,6 +29,14 @@ namespace Doctrine\ORM\Mapping; ...@@ -29,6 +29,14 @@ namespace Doctrine\ORM\Mapping;
* In other words, the many-side MUST be the owning side and the one-side MUST be * In other words, the many-side MUST be the owning side and the one-side MUST be
* the inverse side. * the inverse side.
* *
* <b>IMPORTANT NOTE:</b>
*
* The fields of this class are only public for 2 reasons:
* 1) To allow fast, internal READ access.
* 2) To drastically reduce the size of a serialized instance (private/protected members
* get the whole class name, namespace inclusive, prepended to every property in
* the serialized representation).
*
* @author Roman Borschel <roman@code-factory.org> * @author Roman Borschel <roman@code-factory.org>
* @since 2.0 * @since 2.0
*/ */
...@@ -51,7 +59,7 @@ class OneToManyMapping extends AssociationMapping ...@@ -51,7 +59,7 @@ class OneToManyMapping extends AssociationMapping
//protected $_sourceKeysToTargetForeignKeys; //protected $_sourceKeysToTargetForeignKeys;
/** Whether to delete orphaned elements (removed from the collection) */ /** Whether to delete orphaned elements (removed from the collection) */
private $_deleteOrphans = false; public $deleteOrphans = false;
/** /**
* Initializes a new OneToManyMapping. * Initializes a new OneToManyMapping.
...@@ -79,7 +87,7 @@ class OneToManyMapping extends AssociationMapping ...@@ -79,7 +87,7 @@ class OneToManyMapping extends AssociationMapping
throw MappingException::oneToManyRequiresMappedBy($mapping['fieldName']); throw MappingException::oneToManyRequiresMappedBy($mapping['fieldName']);
} }
$this->_deleteOrphans = isset($mapping['deleteOrphans']) ? $this->deleteOrphans = isset($mapping['deleteOrphans']) ?
(bool)$mapping['deleteOrphans'] : false; (bool)$mapping['deleteOrphans'] : false;
} }
...@@ -90,7 +98,7 @@ class OneToManyMapping extends AssociationMapping ...@@ -90,7 +98,7 @@ class OneToManyMapping extends AssociationMapping
*/ */
public function shouldDeleteOrphans() public function shouldDeleteOrphans()
{ {
return $this->_deleteOrphans; return $this->deleteOrphans;
} }
/** /**
......
...@@ -25,6 +25,14 @@ namespace Doctrine\ORM\Mapping; ...@@ -25,6 +25,14 @@ namespace Doctrine\ORM\Mapping;
* A one-to-one mapping describes a uni-directional mapping from one entity * A one-to-one mapping describes a uni-directional mapping from one entity
* to another entity. * to another entity.
* *
* <b>IMPORTANT NOTE:</b>
*
* The fields of this class are only public for 2 reasons:
* 1) To allow fast, internal READ access.
* 2) To drastically reduce the size of a serialized instance (private/protected members
* get the whole class name, namespace inclusive, prepended to every property in
* the serialized representation).
*
* @since 2.0 * @since 2.0
* @author Roman Borschel <roman@code-factory.org> * @author Roman Borschel <roman@code-factory.org>
*/ */
...@@ -35,28 +43,28 @@ class OneToOneMapping extends AssociationMapping ...@@ -35,28 +43,28 @@ class OneToOneMapping extends AssociationMapping
* i.e. source.id (pk) => target.user_id (fk). * i.e. source.id (pk) => target.user_id (fk).
* Reverse mapping of _targetToSourceKeyColumns. * Reverse mapping of _targetToSourceKeyColumns.
*/ */
private $_sourceToTargetKeyColumns = array(); public $sourceToTargetKeyColumns = array();
/** /**
* Maps the target primary/foreign key columns to the source foreign/primary key columns. * Maps the target primary/foreign key columns to the source foreign/primary key columns.
* i.e. target.user_id (fk) => source.id (pk). * i.e. target.user_id (fk) => source.id (pk).
* Reverse mapping of _sourceToTargetKeyColumns. * Reverse mapping of _sourceToTargetKeyColumns.
*/ */
private $_targetToSourceKeyColumns = array(); public $targetToSourceKeyColumns = array();
/** /**
* Whether to delete orphaned elements (when nulled out, i.e. $foo->other = null) * Whether to delete orphaned elements (when nulled out, i.e. $foo->other = null)
* *
* @var boolean * @var boolean
*/ */
private $_deleteOrphans = false; public $deleteOrphans = false;
/** /**
* The join column definitions. * The join column definitions.
* *
* @var array * @var array
*/ */
private $_joinColumns = array(); public $joinColumns = array();
/** /**
* Creates a new OneToOneMapping. * Creates a new OneToOneMapping.
...@@ -83,14 +91,14 @@ class OneToOneMapping extends AssociationMapping ...@@ -83,14 +91,14 @@ class OneToOneMapping extends AssociationMapping
if ( ! isset($mapping['joinColumns'])) { if ( ! isset($mapping['joinColumns'])) {
throw MappingException::invalidMapping($this->_sourceFieldName); throw MappingException::invalidMapping($this->_sourceFieldName);
} }
$this->_joinColumns = $mapping['joinColumns']; $this->joinColumns = $mapping['joinColumns'];
foreach ($mapping['joinColumns'] as $joinColumn) { foreach ($mapping['joinColumns'] as $joinColumn) {
$this->_sourceToTargetKeyColumns[$joinColumn['name']] = $joinColumn['referencedColumnName']; $this->sourceToTargetKeyColumns[$joinColumn['name']] = $joinColumn['referencedColumnName'];
} }
$this->_targetToSourceKeyColumns = array_flip($this->_sourceToTargetKeyColumns); $this->targetToSourceKeyColumns = array_flip($this->sourceToTargetKeyColumns);
} }
$this->_deleteOrphans = isset($mapping['deleteOrphans']) ? $this->deleteOrphans = isset($mapping['deleteOrphans']) ?
(bool)$mapping['deleteOrphans'] : false; (bool)$mapping['deleteOrphans'] : false;
return $mapping; return $mapping;
...@@ -103,7 +111,7 @@ class OneToOneMapping extends AssociationMapping ...@@ -103,7 +111,7 @@ class OneToOneMapping extends AssociationMapping
*/ */
public function getJoinColumns() public function getJoinColumns()
{ {
return $this->_joinColumns; return $this->joinColumns;
} }
/** /**
...@@ -113,7 +121,7 @@ class OneToOneMapping extends AssociationMapping ...@@ -113,7 +121,7 @@ class OneToOneMapping extends AssociationMapping
*/ */
public function getSourceToTargetKeyColumns() public function getSourceToTargetKeyColumns()
{ {
return $this->_sourceToTargetKeyColumns; return $this->sourceToTargetKeyColumns;
} }
/** /**
...@@ -123,7 +131,7 @@ class OneToOneMapping extends AssociationMapping ...@@ -123,7 +131,7 @@ class OneToOneMapping extends AssociationMapping
*/ */
public function getTargetToSourceKeyColumns() public function getTargetToSourceKeyColumns()
{ {
return $this->_targetToSourceKeyColumns; return $this->targetToSourceKeyColumns;
} }
/** /**
...@@ -146,31 +154,31 @@ class OneToOneMapping extends AssociationMapping ...@@ -146,31 +154,31 @@ class OneToOneMapping extends AssociationMapping
*/ */
public function load($owningEntity, $targetEntity, $em) public function load($owningEntity, $targetEntity, $em)
{ {
$sourceClass = $em->getClassMetadata($this->_sourceEntityName); $sourceClass = $em->getClassMetadata($this->sourceEntityName);
$targetClass = $em->getClassMetadata($this->_targetEntityName); $targetClass = $em->getClassMetadata($this->targetEntityName);
$conditions = array(); $conditions = array();
if ($this->_isOwningSide) { if ($this->isOwningSide) {
foreach ($this->_sourceToTargetKeyColumns as $sourceKeyColumn => $targetKeyColumn) { foreach ($this->sourceToTargetKeyColumns as $sourceKeyColumn => $targetKeyColumn) {
$conditions[$targetKeyColumn] = $sourceClass->getReflectionProperty( $conditions[$targetKeyColumn] = $sourceClass->getReflectionProperty(
$sourceClass->getFieldName($sourceKeyColumn))->getValue($owningEntity); $sourceClass->getFieldName($sourceKeyColumn))->getValue($owningEntity);
} }
if ($targetClass->hasInverseAssociation($this->_sourceFieldName)) { if ($targetClass->hasInverseAssociation($this->sourceFieldName)) {
$targetClass->setFieldValue( $targetClass->setFieldValue(
$targetEntity, $targetEntity,
$targetClass->inverseMappings[$this->_sourceFieldName]->getSourceFieldName(), $targetClass->inverseMappings[$this->_sourceFieldName]->getSourceFieldName(),
$owningEntity); $owningEntity);
} }
} else { } else {
$owningAssoc = $em->getClassMetadata($this->_targetEntityName)->getAssociationMapping($this->_mappedByFieldName); $owningAssoc = $em->getClassMetadata($this->targetEntityName)->getAssociationMapping($this->mappedByFieldName);
foreach ($owningAssoc->getTargetToSourceKeyColumns() as $targetKeyColumn => $sourceKeyColumn) { foreach ($owningAssoc->getTargetToSourceKeyColumns() as $targetKeyColumn => $sourceKeyColumn) {
$conditions[$sourceKeyColumn] = $sourceClass->getReflectionProperty( $conditions[$sourceKeyColumn] = $sourceClass->getReflectionProperty(
$sourceClass->getFieldName($targetKeyColumn))->getValue($owningEntity); $sourceClass->getFieldName($targetKeyColumn))->getValue($owningEntity);
} }
$targetClass->setFieldValue($targetEntity, $this->_mappedByFieldName, $owningEntity); $targetClass->setFieldValue($targetEntity, $this->mappedByFieldName, $owningEntity);
} }
$em->getUnitOfWork()->getEntityPersister($this->_targetEntityName)->load($conditions, $targetEntity); $em->getUnitOfWork()->getEntityPersister($this->targetEntityName)->load($conditions, $targetEntity);
} }
} }
\ No newline at end of file
...@@ -272,12 +272,11 @@ abstract class AbstractEntityPersister ...@@ -272,12 +272,11 @@ abstract class AbstractEntityPersister
$entity = $this->_em->getUnitOfWork()->createEntity($this->_entityName, $data); $entity = $this->_em->getUnitOfWork()->createEntity($this->_entityName, $data);
} else { } else {
foreach ($data as $field => $value) { foreach ($data as $field => $value) {
$this->_class->setFieldValue($entity, $field, $value); $this->_class->reflFields[$field]->setValue($entity, $value);
} }
$id = array(); $id = array();
if ($this->_class->isIdentifierComposite()) { if ($this->_class->isIdentifierComposite()) {
$identifierFieldNames = $this->_class->identifier; foreach ($this->_class->identifier as $fieldName) {
foreach ($identifierFieldNames as $fieldName) {
$id[] = $data[$fieldName]; $id[] = $data[$fieldName];
} }
} else { } else {
...@@ -292,15 +291,15 @@ abstract class AbstractEntityPersister ...@@ -292,15 +291,15 @@ abstract class AbstractEntityPersister
if ($assoc->isLazilyFetched()) { if ($assoc->isLazilyFetched()) {
// Inject proxy // Inject proxy
$proxy = $this->_em->getProxyGenerator()->getAssociationProxy($entity, $assoc); $proxy = $this->_em->getProxyGenerator()->getAssociationProxy($entity, $assoc);
$this->_class->setFieldValue($entity, $field, $proxy); $this->_class->reflFields[$field]->setValue($entity, $proxy);
} else { } else {
//TODO: Eager fetch? //TODO: Eager fetch?
} }
} else { } else {
// Inject collection // Inject collection
$this->_class->getReflectionProperty($field) $this->_class->reflFields[$field]->setValue(
->setValue($entity, new PersistentCollection($this->_em, $entity, new PersistentCollection($this->_em,
$this->_em->getClassMetadata($assoc->getTargetEntityName()) $this->_em->getClassMetadata($assoc->targetEntityName)
)); ));
} }
} }
...@@ -318,8 +317,7 @@ abstract class AbstractEntityPersister ...@@ -318,8 +317,7 @@ abstract class AbstractEntityPersister
protected function _getSelectSingleEntitySql(array $criteria) protected function _getSelectSingleEntitySql(array $criteria)
{ {
$columnList = ''; $columnList = '';
$columnNames = $this->_class->getColumnNames(); foreach ($this->_class->columnNames as $column) {
foreach ($columnNames as $column) {
if ($columnList != '') $columnList .= ', '; if ($columnList != '') $columnList .= ', ';
$columnList .= $column; $columnList .= $column;
} }
...@@ -327,7 +325,7 @@ abstract class AbstractEntityPersister ...@@ -327,7 +325,7 @@ abstract class AbstractEntityPersister
$conditionSql = ''; $conditionSql = '';
foreach ($criteria as $field => $value) { foreach ($criteria as $field => $value) {
if ($conditionSql != '') $conditionSql .= ' AND '; if ($conditionSql != '') $conditionSql .= ' AND ';
$conditionSql .= $this->_class->getColumnName($field) . ' = ?'; $conditionSql .= $this->_class->columnNames[$field] . ' = ?';
} }
return 'SELECT ' . $columnList . ' FROM ' . $this->_class->getTableName() return 'SELECT ' . $columnList . ' FROM ' . $this->_class->getTableName()
......
...@@ -65,38 +65,75 @@ class ResultSetMapping ...@@ -65,38 +65,75 @@ class ResultSetMapping
$this->aliasMap[$alias] = $class; $this->aliasMap[$alias] = $class;
} }
/**
*
* @param <type> $className
* @param <type> $alias
* @param <type> $discrColumn
*/
public function setDiscriminatorColumn($className, $alias, $discrColumn) public function setDiscriminatorColumn($className, $alias, $discrColumn)
{ {
$this->discriminatorColumns[$className] = $discrColumn; $this->discriminatorColumns[$className] = $discrColumn;
$this->columnOwnerMap[$discrColumn] = $alias; $this->columnOwnerMap[$discrColumn] = $alias;
} }
/**
*
* @param string $className
* @return string
*/
public function getDiscriminatorColumn($className) public function getDiscriminatorColumn($className)
{ {
return isset($this->discriminatorColumns[$className]) ? return isset($this->discriminatorColumns[$className]) ?
$this->discriminatorColumns[$className] : null; $this->discriminatorColumns[$className] : null;
} }
/**
*
* @param string $alias
* @param string $fieldName
*/
public function addIndexBy($alias, $fieldName) public function addIndexBy($alias, $fieldName)
{ {
$this->indexByMap[$alias] = $fieldName; $this->indexByMap[$alias] = $fieldName;
} }
/**
*
* @param string $alias
* @return boolean
*/
public function hasIndexBy($alias) public function hasIndexBy($alias)
{ {
return isset($this->indexByMap[$alias]); return isset($this->indexByMap[$alias]);
} }
/**
*
* @param string $alias
* @return string
*/
public function getIndexByField($alias) public function getIndexByField($alias)
{ {
return $this->indexByMap[$alias]; return $this->indexByMap[$alias];
} }
/**
*
* @param string $columnName
* @return boolean
*/
public function isFieldResult($columnName) public function isFieldResult($columnName)
{ {
return isset($this->fieldMappings[$columnName]); return isset($this->fieldMappings[$columnName]);
} }
/**
*
* @param <type> $alias
* @param <type> $columnName
* @param <type> $fieldName
*/
public function addFieldResult($alias, $columnName, $fieldName) public function addFieldResult($alias, $columnName, $fieldName)
{ {
$this->fieldMappings[$columnName] = $fieldName; $this->fieldMappings[$columnName] = $fieldName;
...@@ -106,6 +143,13 @@ class ResultSetMapping ...@@ -106,6 +143,13 @@ class ResultSetMapping
} }
} }
/**
*
* @param <type> $class
* @param <type> $alias
* @param <type> $parentAlias
* @param <type> $relation
*/
public function addJoinedEntityResult($class, $alias, $parentAlias, $relation) public function addJoinedEntityResult($class, $alias, $parentAlias, $relation)
{ {
$this->aliasMap[$alias] = $class; $this->aliasMap[$alias] = $class;
...@@ -164,11 +208,21 @@ class ResultSetMapping ...@@ -164,11 +208,21 @@ class ResultSetMapping
return $this->aliasMap[$this->columnOwnerMap[$columnName]]; return $this->aliasMap[$this->columnOwnerMap[$columnName]];
} }
/**
*
* @param string $alias
* @return AssociationMapping
*/
public function getRelation($alias) public function getRelation($alias)
{ {
return $this->relationMap[$alias]; return $this->relationMap[$alias];
} }
/**
*
* @param string $alias
* @return boolean
*/
public function isRelation($alias) public function isRelation($alias)
{ {
return isset($this->relationMap[$alias]); return isset($this->relationMap[$alias]);
...@@ -186,50 +240,77 @@ class ResultSetMapping ...@@ -186,50 +240,77 @@ class ResultSetMapping
/** /**
* *
* @param <type> $alias * @param string $alias
* @return <type> * @return string
*/ */
public function getParentAlias($alias) public function getParentAlias($alias)
{ {
return $this->parentAliasMap[$alias]; return $this->parentAliasMap[$alias];
} }
/**
*
* @param string $alias
* @return boolean
*/
public function hasParentAlias($alias) public function hasParentAlias($alias)
{ {
return isset($this->parentAliasMap[$alias]); return isset($this->parentAliasMap[$alias]);
} }
/** /**
* Gets the field name for a column name.
* *
* @param <type> $className * @param string $columnName
* @param <type> $columnName * @return string
* @return <type>
*/ */
public function getFieldName($columnName) public function getFieldName($columnName)
{ {
return $this->fieldMappings[$columnName]; return $this->fieldMappings[$columnName];
} }
/**
*
* @return array
*/
public function getAliasMap() public function getAliasMap()
{ {
return $this->aliasMap; return $this->aliasMap;
} }
/**
*
* @return integer
*/
public function getEntityResultCount() public function getEntityResultCount()
{ {
return count($this->aliasMap); return count($this->aliasMap);
} }
/**
*
* @return boolean
*/
public function isMixedResult() public function isMixedResult()
{ {
return $this->isMixed; return $this->isMixed;
} }
/**
* Adds a column name that will be ignored during hydration.
*
* @param string $columnName
*/
public function addIgnoredColumn($columnName) public function addIgnoredColumn($columnName)
{ {
$this->ignoredColumns[$columnName] = true; $this->ignoredColumns[$columnName] = true;
} }
/**
*
* @param string $columnName
* @return boolean
*/
public function isIgnoredColumn($columnName) public function isIgnoredColumn($columnName)
{ {
return isset($this->ignoredColumns[$columnName]); return isset($this->ignoredColumns[$columnName]);
......
...@@ -144,9 +144,9 @@ class HydrationPerformanceTest extends \Doctrine\Tests\OrmPerformanceTestCase ...@@ -144,9 +144,9 @@ class HydrationPerformanceTest extends \Doctrine\Tests\OrmPerformanceTestCase
} }
/** /**
* [romanb: 10000 rows => 3.4 seconds] * [romanb: 10000 rows => 3.8 seconds]
* *
* MAXIMUM TIME: 4 seconds * MAXIMUM TIME: 5 seconds
*/ */
public function testSimpleQueryObjectHydrationPerformance() public function testSimpleQueryObjectHydrationPerformance()
{ {
...@@ -192,7 +192,7 @@ class HydrationPerformanceTest extends \Doctrine\Tests\OrmPerformanceTestCase ...@@ -192,7 +192,7 @@ class HydrationPerformanceTest extends \Doctrine\Tests\OrmPerformanceTestCase
$stmt = new HydratorMockStatement($resultSet); $stmt = new HydratorMockStatement($resultSet);
$hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em);
$this->setMaxRunningTime(4); $this->setMaxRunningTime(5);
$result = $hydrator->hydrateAll($stmt, $rsm); $result = $hydrator->hydrateAll($stmt, $rsm);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment