1
0
mirror of synced 2024-12-05 03:06:05 +03:00

Removed unused methods

This commit is contained in:
Asmir Mustafic 2015-01-29 22:36:07 +01:00 committed by Marco Pivetta
parent 7948b0c160
commit 4323d9ce4c

View File

@ -131,40 +131,4 @@ class PersisterHelper
$class->getName()
));
}
/**
* @param mixed $value
* @param EntityManagerInterface $em
*
* @return mixed
*/
public static function getIdentifierValues($value, EntityManagerInterface $em)
{
if ( ! is_array($value)) {
return self::getIndividualValue($value, $em);
}
$newValue = array();
foreach ($value as $fieldName => $fieldValue) {
$newValue[$fieldName] = self::getIndividualValue($fieldValue, $em);
}
return $newValue;
}
/**
* @param mixed $value
* @param EntityManagerInterface $em
*
* @return mixed
*/
private static function getIndividualValue($value, EntityManagerInterface $em)
{
if ( ! is_object($value) || ! $em->getMetadataFactory()->hasMetadataFor(ClassUtils::getClass($value))) {
return $value;
}
return $em->getUnitOfWork()->getSingleIdentifierValue($value);
}
}