Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
rename parameters to match parents
  • Loading branch information
orklah committed Sep 25, 2020
commit 562a4e1b752d6610d3fc31444482fdf4e41b46c6
20 changes: 10 additions & 10 deletions lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -544,18 +544,18 @@ public function loadCriteria(Criteria $criteria)
/**
* {@inheritdoc}
*/
public function loadManyToManyCollection(array $assoc, $sourceEntity, PersistentCollection $coll)
public function loadManyToManyCollection(array $assoc, $sourceEntity, PersistentCollection $collection)
{
$persister = $this->uow->getCollectionPersister($assoc);
$hasCache = ($persister instanceof CachedPersister);

if ( ! $hasCache) {
return $this->persister->loadManyToManyCollection($assoc, $sourceEntity, $coll);
return $this->persister->loadManyToManyCollection($assoc, $sourceEntity, $collection);
}

$ownerId = $this->uow->getEntityIdentifier($coll->getOwner());
$ownerId = $this->uow->getEntityIdentifier($collection->getOwner());
$key = $this->buildCollectionCacheKey($assoc, $ownerId);
$list = $persister->loadCollectionCache($coll, $key);
$list = $persister->loadCollectionCache($collection, $key);

if ($list !== null) {
if ($this->cacheLogger) {
Expand All @@ -565,7 +565,7 @@ public function loadManyToManyCollection(array $assoc, $sourceEntity, Persistent
return $list;
}

$list = $this->persister->loadManyToManyCollection($assoc, $sourceEntity, $coll);
$list = $this->persister->loadManyToManyCollection($assoc, $sourceEntity, $collection);

$persister->storeCollectionCache($key, $list);

Expand All @@ -579,18 +579,18 @@ public function loadManyToManyCollection(array $assoc, $sourceEntity, Persistent
/**
* {@inheritdoc}
*/
public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentCollection $coll)
public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentCollection $collection)
{
$persister = $this->uow->getCollectionPersister($assoc);
$hasCache = ($persister instanceof CachedPersister);

if ( ! $hasCache) {
return $this->persister->loadOneToManyCollection($assoc, $sourceEntity, $coll);
return $this->persister->loadOneToManyCollection($assoc, $sourceEntity, $collection);
}

$ownerId = $this->uow->getEntityIdentifier($coll->getOwner());
$ownerId = $this->uow->getEntityIdentifier($collection->getOwner());
$key = $this->buildCollectionCacheKey($assoc, $ownerId);
$list = $persister->loadCollectionCache($coll, $key);
$list = $persister->loadCollectionCache($collection, $key);

if ($list !== null) {
if ($this->cacheLogger) {
Expand All @@ -600,7 +600,7 @@ public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentC
return $list;
}

$list = $this->persister->loadOneToManyCollection($assoc, $sourceEntity, $coll);
$list = $this->persister->loadOneToManyCollection($assoc, $sourceEntity, $collection);

$persister->storeCollectionCache($key, $list);

Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ public function lock($entity, $lockMode, $lockVersion = null)
/**
* {@inheritdoc}
*/
public function find($entityName, $id, $lockMode = null, $lockVersion = null)
public function find($className, $id, $lockMode = null, $lockVersion = null)
{
return $this->wrapped->find($entityName, $id, $lockMode, $lockVersion);
return $this->wrapped->find($className, $id, $lockMode, $lockVersion);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions lib/Doctrine/ORM/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public function flush($entity = null)
/**
* Finds an Entity by its identifier.
*
* @param string $entityName The class name of the entity to find.
* @param string $className The class name of the entity to find.
* @param mixed $id The identity of the entity to find.
* @param integer|null $lockMode One of the \Doctrine\DBAL\LockMode::* constants
* or NULL if no specific lock mode should be used
Expand All @@ -388,9 +388,9 @@ public function flush($entity = null)
* @throws TransactionRequiredException
* @throws ORMException
*/
public function find($entityName, $id, $lockMode = null, $lockVersion = null)
public function find($className, $id, $lockMode = null, $lockVersion = null)
{
$class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\'));
$class = $this->metadataFactory->getMetadataFor(ltrim($className, '\\'));

if ($lockMode !== null) {
$this->checkLockRequirements($lockMode, $class);
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,14 @@ protected function cleanup()
*
* Template method.
*
* @param array $data The row data.
* @param array $row The row data.
* @param array $result The result to fill.
*
* @return void
*
* @throws HydrationException
*/
protected function hydrateRowData(array $data, array &$result)
protected function hydrateRowData(array $row, array &$result)
{
throw new HydrationException("hydrateRowData() not implemented by this hydrator.");
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ protected function hydrateAllData()
/**
* {@inheritdoc}
*/
protected function hydrateRowData(array $data, array &$result)
protected function hydrateRowData(array $row, array &$result)
{
$result[] = $this->gatherScalarRowData($data);
$result[] = $this->gatherScalarRowData($row);
}
}
18 changes: 9 additions & 9 deletions lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected function hydrateAllData()
/**
* {@inheritdoc}
*/
protected function hydrateRowData(array $sqlResult, array &$result)
protected function hydrateRowData(array $row, array &$result)
{
$entityName = $this->class->name;
$data = [];
Expand All @@ -92,27 +92,27 @@ protected function hydrateRowData(array $sqlResult, array &$result)
$discrColumnName = $metaMappingDiscrColumnName;
}

if ( ! isset($sqlResult[$discrColumnName])) {
if ( ! isset($row[$discrColumnName])) {
throw HydrationException::missingDiscriminatorColumn($entityName, $discrColumnName, key($this->_rsm->aliasMap));
}

if ($sqlResult[$discrColumnName] === '') {
if ($row[$discrColumnName] === '') {
throw HydrationException::emptyDiscriminatorValue(key($this->_rsm->aliasMap));
}

$discrMap = $this->class->discriminatorMap;

if ( ! isset($discrMap[$sqlResult[$discrColumnName]])) {
throw HydrationException::invalidDiscriminatorValue($sqlResult[$discrColumnName], array_keys($discrMap));
if ( ! isset($discrMap[$row[$discrColumnName]])) {
throw HydrationException::invalidDiscriminatorValue($row[$discrColumnName], array_keys($discrMap));
}

$entityName = $discrMap[$sqlResult[$discrColumnName]];
$discrColumnValue = $sqlResult[$discrColumnName];
$entityName = $discrMap[$row[$discrColumnName]];
$discrColumnValue = $row[$discrColumnName];

unset($sqlResult[$discrColumnName]);
unset($row[$discrColumnName]);
}

foreach ($sqlResult as $column => $value) {
foreach ($row as $column => $value) {
// An ObjectHydrator should be used instead of SimpleObjectHydrator
if (isset($this->_rsm->relationMap[$column])) {
throw new \Exception(sprintf('Unable to retrieve association information for column "%s"', $column));
Expand Down
8 changes: 4 additions & 4 deletions lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -987,11 +987,11 @@ private function loadCollectionFromStatement($assoc, $stmt, $coll)
/**
* {@inheritdoc}
*/
public function loadManyToManyCollection(array $assoc, $sourceEntity, PersistentCollection $coll)
public function loadManyToManyCollection(array $assoc, $sourceEntity, PersistentCollection $collection)
{
$stmt = $this->getManyToManyStatement($assoc, $sourceEntity);

return $this->loadCollectionFromStatement($assoc, $stmt, $coll);
return $this->loadCollectionFromStatement($assoc, $stmt, $collection);
}

/**
Expand Down Expand Up @@ -1795,11 +1795,11 @@ public function getOneToManyCollection(array $assoc, $sourceEntity, $offset = nu
/**
* {@inheritdoc}
*/
public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentCollection $coll)
public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentCollection $collection)
{
$stmt = $this->getOneToManyStatement($assoc, $sourceEntity);

return $this->loadCollectionFromStatement($assoc, $stmt, $coll);
return $this->loadCollectionFromStatement($assoc, $stmt, $collection);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions lib/Doctrine/ORM/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -3214,17 +3214,17 @@ public function clearEntityChangeSet($oid)
/**
* Notifies this UnitOfWork of a property change in an entity.
*
* @param object $entity The entity that owns the property.
* @param object $sender The entity that owns the property.
* @param string $propertyName The name of the property that changed.
* @param mixed $oldValue The old value of the property.
* @param mixed $newValue The new value of the property.
*
* @return void
*/
public function propertyChanged($entity, $propertyName, $oldValue, $newValue)
public function propertyChanged($sender, $propertyName, $oldValue, $newValue)
{
$oid = spl_object_hash($entity);
$class = $this->em->getClassMetadata(get_class($entity));
$oid = spl_object_hash($sender);
$class = $this->em->getClassMetadata(get_class($sender));

$isAssocField = isset($class->associationMappings[$propertyName]);

Expand All @@ -3236,7 +3236,7 @@ public function propertyChanged($entity, $propertyName, $oldValue, $newValue)
$this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue];

if ( ! isset($this->scheduledForSynchronization[$class->rootEntityName][$oid])) {
$this->scheduleForDirtyCheck($entity);
$this->scheduleForDirtyCheck($sender);
}
}

Expand Down