Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #12 from silvano-a/queue-manager-fix
Browse files Browse the repository at this point in the history
Fix QueueManager::getObjectSettings for Doctrine proxy instances
  • Loading branch information
niels-nijens committed Jan 12, 2017
2 parents 096de3b + a44f550 commit 326ab5d
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Queue/QueueManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,20 +141,24 @@ public function getQueueResults()
/**
* Returns the object settings based on the class name.
*
* @param string $className
*
* @return array
*/
private function getObjectSettings($className)
{
if (isset($this->objectsMap[$className]) === false) {
$reflectionClass = new ReflectionClass($className);

$this->objectsMap[$className] = array(
'service' => strtolower($reflectionClass->getShortName()),
'action' => 'save',
);
foreach ($this->objectsMap as $mapClass => $parameters) {
if ($mapClass === $className || is_subclass_of($className, $mapClass)) {
return $parameters;
}
}

return $this->objectsMap[$className];
$reflectionClass = new ReflectionClass($className);

return array(
'service' => strtolower($reflectionClass->getShortName()),
'action' => 'save',
);
}

/**
Expand Down

0 comments on commit 326ab5d

Please sign in to comment.