2007-11-20 17:26:42 +03:00
|
|
|
<?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 LGPL. For more information, see
|
2009-02-17 13:54:18 +03:00
|
|
|
* <http://www.doctrine-project.org>.
|
2007-11-20 17:26:42 +03:00
|
|
|
*/
|
|
|
|
|
2009-01-22 22:38:10 +03:00
|
|
|
namespace Doctrine\ORM\Internal\Hydration;
|
|
|
|
|
2010-03-29 17:20:41 +04:00
|
|
|
use PDO,
|
|
|
|
Doctrine\DBAL\Connection,
|
|
|
|
Doctrine\DBAL\Types\Type,
|
|
|
|
Doctrine\ORM\EntityManager;
|
2008-09-12 13:58:02 +04:00
|
|
|
|
2007-11-20 17:26:42 +03:00
|
|
|
/**
|
2009-04-12 23:02:12 +04:00
|
|
|
* Base class for all hydrators. A hydrator is a class that provides some form
|
|
|
|
* of transformation of an SQL result set into another structure.
|
2007-11-20 17:26:42 +03:00
|
|
|
*
|
2009-01-14 00:56:43 +03:00
|
|
|
* @since 2.0
|
2007-11-20 17:26:42 +03:00
|
|
|
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
2008-07-27 23:38:56 +04:00
|
|
|
* @author Roman Borschel <roman@code-factory.org>
|
2007-11-20 17:26:42 +03:00
|
|
|
*/
|
2009-01-22 22:38:10 +03:00
|
|
|
abstract class AbstractHydrator
|
2007-11-20 17:26:42 +03:00
|
|
|
{
|
2009-12-07 15:47:23 +03:00
|
|
|
/** @var ResultSetMapping The ResultSetMapping. */
|
2009-05-14 22:34:12 +04:00
|
|
|
protected $_rsm;
|
2008-05-24 22:18:37 +04:00
|
|
|
|
2009-01-14 00:56:43 +03:00
|
|
|
/** @var EntityManager The EntityManager instance. */
|
2008-05-14 01:20:34 +04:00
|
|
|
protected $_em;
|
2007-11-20 17:26:42 +03:00
|
|
|
|
2009-06-20 17:56:46 +04:00
|
|
|
/** @var AbstractPlatform The dbms Platform instance */
|
|
|
|
protected $_platform;
|
|
|
|
|
2009-01-14 00:56:43 +03:00
|
|
|
/** @var UnitOfWork The UnitOfWork of the associated EntityManager. */
|
|
|
|
protected $_uow;
|
|
|
|
|
|
|
|
/** @var array The cache used during row-by-row hydration. */
|
|
|
|
protected $_cache = array();
|
|
|
|
|
|
|
|
/** @var Statement The statement that provides the data to hydrate. */
|
|
|
|
protected $_stmt;
|
2010-03-29 17:20:41 +04:00
|
|
|
|
2009-07-21 13:25:14 +04:00
|
|
|
/** @var array The query hints. */
|
|
|
|
protected $_hints;
|
2009-01-14 00:56:43 +03:00
|
|
|
|
2007-11-20 17:26:42 +03:00
|
|
|
/**
|
2009-04-12 23:02:12 +04:00
|
|
|
* Initializes a new instance of a class derived from <tt>AbstractHydrator</tt>.
|
2007-11-20 17:26:42 +03:00
|
|
|
*
|
2009-01-14 00:56:43 +03:00
|
|
|
* @param Doctrine\ORM\EntityManager $em The EntityManager to use.
|
2007-11-20 17:26:42 +03:00
|
|
|
*/
|
2010-03-29 17:20:41 +04:00
|
|
|
public function __construct(EntityManager $em)
|
2008-03-19 21:33:14 +03:00
|
|
|
{
|
2008-05-14 01:20:34 +04:00
|
|
|
$this->_em = $em;
|
2009-06-20 16:59:33 +04:00
|
|
|
$this->_platform = $em->getConnection()->getDatabasePlatform();
|
2009-01-14 00:56:43 +03:00
|
|
|
$this->_uow = $em->getUnitOfWork();
|
2008-03-19 21:33:14 +03:00
|
|
|
}
|
2007-11-20 17:26:42 +03:00
|
|
|
|
|
|
|
/**
|
2009-01-14 00:56:43 +03:00
|
|
|
* Initiates a row-by-row hydration.
|
2008-05-24 22:18:37 +04:00
|
|
|
*
|
2009-01-14 00:56:43 +03:00
|
|
|
* @param object $stmt
|
2009-04-12 23:02:12 +04:00
|
|
|
* @param object $resultSetMapping
|
2009-01-14 00:56:43 +03:00
|
|
|
* @return IterableResult
|
|
|
|
*/
|
2009-10-28 13:31:47 +03:00
|
|
|
public function iterate($stmt, $resultSetMapping, array $hints = array())
|
2009-01-14 00:56:43 +03:00
|
|
|
{
|
|
|
|
$this->_stmt = $stmt;
|
2009-05-14 22:34:12 +04:00
|
|
|
$this->_rsm = $resultSetMapping;
|
2009-10-28 13:31:47 +03:00
|
|
|
$this->_hints = $hints;
|
2009-04-12 23:02:12 +04:00
|
|
|
$this->_prepare();
|
2009-01-22 22:38:10 +03:00
|
|
|
return new IterableResult($this);
|
2009-01-14 00:56:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hydrates all rows returned by the passed statement instance at once.
|
2007-11-20 17:26:42 +03:00
|
|
|
*
|
2009-01-14 00:56:43 +03:00
|
|
|
* @param object $stmt
|
2009-04-12 23:02:12 +04:00
|
|
|
* @param object $resultSetMapping
|
2009-01-14 00:56:43 +03:00
|
|
|
* @return mixed
|
2007-11-20 17:26:42 +03:00
|
|
|
*/
|
2009-07-21 13:25:14 +04:00
|
|
|
public function hydrateAll($stmt, $resultSetMapping, array $hints = array())
|
2007-11-20 17:26:42 +03:00
|
|
|
{
|
2009-01-14 00:56:43 +03:00
|
|
|
$this->_stmt = $stmt;
|
2009-05-14 22:34:12 +04:00
|
|
|
$this->_rsm = $resultSetMapping;
|
2009-07-21 13:25:14 +04:00
|
|
|
$this->_hints = $hints;
|
2009-04-12 23:02:12 +04:00
|
|
|
$this->_prepare();
|
2009-01-15 16:30:44 +03:00
|
|
|
$result = $this->_hydrateAll();
|
2009-01-14 00:56:43 +03:00
|
|
|
$this->_cleanup();
|
|
|
|
return $result;
|
2007-11-20 17:26:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2009-01-14 00:56:43 +03:00
|
|
|
* Hydrates a single row returned by the current statement instance during
|
|
|
|
* row-by-row hydration with {@link iterate()}.
|
2008-05-24 22:18:37 +04:00
|
|
|
*
|
2009-01-14 00:56:43 +03:00
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function hydrateRow()
|
|
|
|
{
|
2010-03-29 17:20:41 +04:00
|
|
|
$row = $this->_stmt->fetch(PDO::FETCH_ASSOC);
|
2009-01-14 00:56:43 +03:00
|
|
|
if ( ! $row) {
|
|
|
|
$this->_cleanup();
|
|
|
|
return false;
|
|
|
|
}
|
2010-03-29 17:20:41 +04:00
|
|
|
$result = array();
|
2009-01-14 00:56:43 +03:00
|
|
|
$this->_hydrateRow($row, $this->_cache, $result);
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-03-29 17:20:41 +04:00
|
|
|
* Excutes one-time preparation tasks, once each time hydration is started
|
2009-01-14 00:56:43 +03:00
|
|
|
* through {@link hydrateAll} or {@link iterate()}.
|
|
|
|
*/
|
2009-04-12 23:02:12 +04:00
|
|
|
protected function _prepare()
|
|
|
|
{}
|
2009-01-14 00:56:43 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Excutes one-time cleanup tasks at the end of a hydration that was initiated
|
|
|
|
* through {@link hydrateAll} or {@link iterate()}.
|
2007-11-20 17:26:42 +03:00
|
|
|
*/
|
2009-01-14 00:56:43 +03:00
|
|
|
protected function _cleanup()
|
2007-11-20 17:26:42 +03:00
|
|
|
{
|
2009-05-14 22:34:12 +04:00
|
|
|
$this->_rsm = null;
|
2009-01-14 00:56:43 +03:00
|
|
|
$this->_stmt->closeCursor();
|
|
|
|
$this->_stmt = null;
|
2007-11-20 17:26:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2009-01-14 00:56:43 +03:00
|
|
|
* Hydrates a single row from the current statement instance.
|
|
|
|
*
|
|
|
|
* Template method.
|
2008-05-24 22:18:37 +04:00
|
|
|
*
|
2009-01-14 00:56:43 +03:00
|
|
|
* @param array $data The row data.
|
|
|
|
* @param array $cache The cache to use.
|
|
|
|
* @param mixed $result The result to fill.
|
|
|
|
*/
|
2010-03-29 17:20:41 +04:00
|
|
|
protected function _hydrateRow(array $data, array &$cache, array &$result)
|
2009-04-09 22:12:48 +04:00
|
|
|
{
|
2009-12-07 15:47:23 +03:00
|
|
|
throw new HydrationException("_hydrateRow() not implemented by this hydrator.");
|
2009-04-09 22:12:48 +04:00
|
|
|
}
|
2009-01-14 00:56:43 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Hydrates all rows from the current statement instance at once.
|
|
|
|
*/
|
2009-01-15 16:30:44 +03:00
|
|
|
abstract protected function _hydrateAll();
|
2009-01-14 00:56:43 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Processes a row of the result set.
|
2011-11-01 19:42:03 +04:00
|
|
|
*
|
2009-04-03 15:06:58 +04:00
|
|
|
* Used for identity-based hydration (HYDRATE_OBJECT and HYDRATE_ARRAY).
|
2011-11-01 19:42:03 +04:00
|
|
|
* Puts the elements of a result row into a new array, grouped by the dql alias
|
2009-01-14 00:56:43 +03:00
|
|
|
* they belong to. The column names in the result set are mapped to their
|
|
|
|
* field names during this procedure as well as any necessary conversions on
|
2011-11-01 19:42:03 +04:00
|
|
|
* the values applied. Scalar values are kept in a specfic key 'scalars'.
|
2009-01-14 00:56:43 +03:00
|
|
|
*
|
2011-10-16 13:08:11 +04:00
|
|
|
* @param array $data SQL Result Row
|
|
|
|
* @param array &$cache Cache for column to field result information
|
|
|
|
* @param array &$id Dql-Alias => ID-Hash
|
|
|
|
* @param array &$nonemptyComponents Does this DQL-Alias has at least one non NULL value?
|
|
|
|
*
|
2009-01-14 00:56:43 +03:00
|
|
|
* @return array An array with all the fields (name => value) of the data row,
|
2009-05-17 23:27:12 +04:00
|
|
|
* grouped by their component alias.
|
2009-01-14 00:56:43 +03:00
|
|
|
*/
|
2010-03-29 17:20:41 +04:00
|
|
|
protected function _gatherRowData(array $data, array &$cache, array &$id, array &$nonemptyComponents)
|
2007-11-20 17:26:42 +03:00
|
|
|
{
|
2009-01-14 00:56:43 +03:00
|
|
|
$rowData = array();
|
|
|
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
// Parse each column name only once. Cache the results.
|
|
|
|
if ( ! isset($cache[$key])) {
|
2009-07-20 14:52:07 +04:00
|
|
|
if (isset($this->_rsm->scalarMappings[$key])) {
|
2009-05-17 23:27:12 +04:00
|
|
|
$cache[$key]['fieldName'] = $this->_rsm->scalarMappings[$key];
|
2009-01-14 00:56:43 +03:00
|
|
|
$cache[$key]['isScalar'] = true;
|
2009-05-14 22:34:12 +04:00
|
|
|
} else if (isset($this->_rsm->fieldMappings[$key])) {
|
|
|
|
$fieldName = $this->_rsm->fieldMappings[$key];
|
2009-12-19 16:38:54 +03:00
|
|
|
$classMetadata = $this->_em->getClassMetadata($this->_rsm->declaringClasses[$key]);
|
2009-04-03 15:06:58 +04:00
|
|
|
$cache[$key]['fieldName'] = $fieldName;
|
2009-07-20 19:30:54 +04:00
|
|
|
$cache[$key]['type'] = Type::getType($classMetadata->fieldMappings[$fieldName]['type']);
|
2009-04-03 15:06:58 +04:00
|
|
|
$cache[$key]['isIdentifier'] = $classMetadata->isIdentifier($fieldName);
|
2009-05-14 22:34:12 +04:00
|
|
|
$cache[$key]['dqlAlias'] = $this->_rsm->columnOwnerMap[$key];
|
2010-07-28 23:50:25 +04:00
|
|
|
} else if (!isset($this->_rsm->metaMappings[$key])) {
|
|
|
|
// this column is a left over, maybe from a LIMIT query hack for example in Oracle or DB2
|
|
|
|
// maybe from an additional column that has not been defined in a NativeQuery ResultSetMapping.
|
|
|
|
continue;
|
2009-04-12 23:02:12 +04:00
|
|
|
} else {
|
2009-07-20 19:30:54 +04:00
|
|
|
// Meta column (has meaning in relational schema only, i.e. foreign keys or discriminator columns).
|
2010-08-15 20:58:25 +04:00
|
|
|
$fieldName = $this->_rsm->metaMappings[$key];
|
2009-07-20 19:30:54 +04:00
|
|
|
$cache[$key]['isMetaColumn'] = true;
|
2010-08-15 20:58:25 +04:00
|
|
|
$cache[$key]['fieldName'] = $fieldName;
|
2009-05-14 22:34:12 +04:00
|
|
|
$cache[$key]['dqlAlias'] = $this->_rsm->columnOwnerMap[$key];
|
2011-01-23 18:24:08 +03:00
|
|
|
$classMetadata = $this->_em->getClassMetadata($this->_rsm->aliasMap[$cache[$key]['dqlAlias']]);
|
2011-05-18 01:42:24 +04:00
|
|
|
$cache[$key]['isIdentifier'] = isset($this->_rsm->isIdentifierColumn[$cache[$key]['dqlAlias']][$key]);
|
2009-01-14 00:56:43 +03:00
|
|
|
}
|
|
|
|
}
|
2011-11-01 19:42:03 +04:00
|
|
|
|
2009-11-16 20:03:33 +03:00
|
|
|
if (isset($cache[$key]['isScalar'])) {
|
2009-05-13 19:19:27 +04:00
|
|
|
$rowData['scalars'][$cache[$key]['fieldName']] = $value;
|
2009-01-14 00:56:43 +03:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2009-04-03 15:06:58 +04:00
|
|
|
$dqlAlias = $cache[$key]['dqlAlias'];
|
|
|
|
|
2010-08-15 20:58:25 +04:00
|
|
|
if ($cache[$key]['isIdentifier']) {
|
|
|
|
$id[$dqlAlias] .= '|' . $value;
|
|
|
|
}
|
|
|
|
|
2009-07-20 19:30:54 +04:00
|
|
|
if (isset($cache[$key]['isMetaColumn'])) {
|
2011-03-06 23:26:54 +03:00
|
|
|
if (!isset($rowData[$dqlAlias][$cache[$key]['fieldName']]) || $value !== null) {
|
|
|
|
$rowData[$dqlAlias][$cache[$key]['fieldName']] = $value;
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
2011-11-01 19:42:03 +04:00
|
|
|
|
2011-03-06 23:26:54 +03:00
|
|
|
// in an inheritance hierachy the same field could be defined several times.
|
|
|
|
// We overwrite this value so long we dont have a non-null value, that value we keep.
|
|
|
|
// Per definition it cannot be that a field is defined several times and has several values.
|
|
|
|
if (isset($rowData[$dqlAlias][$cache[$key]['fieldName']]) && $value === null) {
|
2009-04-12 23:02:12 +04:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2009-07-20 19:30:54 +04:00
|
|
|
$rowData[$dqlAlias][$cache[$key]['fieldName']] = $cache[$key]['type']->convertToPHPValue($value, $this->_platform);
|
2009-01-14 00:56:43 +03:00
|
|
|
|
|
|
|
if ( ! isset($nonemptyComponents[$dqlAlias]) && $value !== null) {
|
|
|
|
$nonemptyComponents[$dqlAlias] = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $rowData;
|
2007-11-20 17:26:42 +03:00
|
|
|
}
|
2008-05-24 22:18:37 +04:00
|
|
|
|
2008-01-16 17:29:11 +03:00
|
|
|
/**
|
2009-01-14 00:56:43 +03:00
|
|
|
* Processes a row of the result set.
|
2011-11-01 19:42:03 +04:00
|
|
|
*
|
2009-01-14 00:56:43 +03:00
|
|
|
* Used for HYDRATE_SCALAR. This is a variant of _gatherRowData() that
|
2009-11-16 20:03:33 +03:00
|
|
|
* simply converts column names to field names and properly converts the
|
|
|
|
* values according to their types. The resulting row has the same number
|
|
|
|
* of elements as before.
|
2008-01-16 17:29:11 +03:00
|
|
|
*
|
2009-01-14 00:56:43 +03:00
|
|
|
* @param array $data
|
|
|
|
* @param array $cache
|
|
|
|
* @return array The processed row.
|
2008-01-16 17:29:11 +03:00
|
|
|
*/
|
2009-01-14 00:56:43 +03:00
|
|
|
protected function _gatherScalarRowData(&$data, &$cache)
|
2008-01-16 17:29:11 +03:00
|
|
|
{
|
2009-01-14 00:56:43 +03:00
|
|
|
$rowData = array();
|
|
|
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
// Parse each column name only once. Cache the results.
|
|
|
|
if ( ! isset($cache[$key])) {
|
2009-07-20 14:52:07 +04:00
|
|
|
if (isset($this->_rsm->scalarMappings[$key])) {
|
2009-05-14 22:34:12 +04:00
|
|
|
$cache[$key]['fieldName'] = $this->_rsm->scalarMappings[$key];
|
2009-01-14 00:56:43 +03:00
|
|
|
$cache[$key]['isScalar'] = true;
|
2009-11-16 20:03:33 +03:00
|
|
|
} else if (isset($this->_rsm->fieldMappings[$key])) {
|
2009-05-14 22:34:12 +04:00
|
|
|
$fieldName = $this->_rsm->fieldMappings[$key];
|
2009-12-19 16:38:54 +03:00
|
|
|
$classMetadata = $this->_em->getClassMetadata($this->_rsm->declaringClasses[$key]);
|
2009-04-03 15:06:58 +04:00
|
|
|
$cache[$key]['fieldName'] = $fieldName;
|
2010-03-15 20:19:00 +03:00
|
|
|
$cache[$key]['type'] = Type::getType($classMetadata->fieldMappings[$fieldName]['type']);
|
2009-05-14 22:34:12 +04:00
|
|
|
$cache[$key]['dqlAlias'] = $this->_rsm->columnOwnerMap[$key];
|
2010-07-28 23:57:05 +04:00
|
|
|
} else if (!isset($this->_rsm->metaMappings[$key])) {
|
|
|
|
// this column is a left over, maybe from a LIMIT query hack for example in Oracle or DB2
|
|
|
|
// maybe from an additional column that has not been defined in a NativeQuery ResultSetMapping.
|
|
|
|
continue;
|
2009-11-16 20:03:33 +03:00
|
|
|
} else {
|
|
|
|
// Meta column (has meaning in relational schema only, i.e. foreign keys or discriminator columns).
|
|
|
|
$cache[$key]['isMetaColumn'] = true;
|
|
|
|
$cache[$key]['fieldName'] = $this->_rsm->metaMappings[$key];
|
|
|
|
$cache[$key]['dqlAlias'] = $this->_rsm->columnOwnerMap[$key];
|
2009-01-14 00:56:43 +03:00
|
|
|
}
|
|
|
|
}
|
2011-11-01 19:42:03 +04:00
|
|
|
|
2009-01-14 00:56:43 +03:00
|
|
|
$fieldName = $cache[$key]['fieldName'];
|
|
|
|
|
2009-11-16 20:03:33 +03:00
|
|
|
if (isset($cache[$key]['isScalar'])) {
|
|
|
|
$rowData[$fieldName] = $value;
|
|
|
|
} else if (isset($cache[$key]['isMetaColumn'])) {
|
|
|
|
$rowData[$cache[$key]['dqlAlias'] . '_' . $fieldName] = $value;
|
2009-01-14 00:56:43 +03:00
|
|
|
} else {
|
2009-11-16 20:03:33 +03:00
|
|
|
$rowData[$cache[$key]['dqlAlias'] . '_' . $fieldName] = $cache[$key]['type']
|
|
|
|
->convertToPHPValue($value, $this->_platform);
|
2009-01-14 00:56:43 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $rowData;
|
2008-01-16 17:29:11 +03:00
|
|
|
}
|
2011-11-01 19:42:03 +04:00
|
|
|
|
2011-07-05 01:19:08 +04:00
|
|
|
protected function registerManaged($class, $entity, $data)
|
|
|
|
{
|
|
|
|
if ($class->isIdentifierComposite) {
|
|
|
|
$id = array();
|
|
|
|
foreach ($class->identifier as $fieldName) {
|
|
|
|
if (isset($class->associationMappings[$fieldName])) {
|
|
|
|
$id[$fieldName] = $data[$class->associationMappings[$fieldName]['joinColumns'][0]['name']];
|
|
|
|
} else {
|
|
|
|
$id[$fieldName] = $data[$fieldName];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (isset($class->associationMappings[$class->identifier[0]])) {
|
|
|
|
$id = array($class->identifier[0] => $data[$class->associationMappings[$class->identifier[0]]['joinColumns'][0]['name']]);
|
|
|
|
} else {
|
|
|
|
$id = array($class->identifier[0] => $data[$class->identifier[0]]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->_em->getUnitOfWork()->registerManaged($entity, $id, $data);
|
|
|
|
}
|
2009-07-20 16:05:19 +04:00
|
|
|
}
|