Added second class to debug 1:n relation, which is working in general
This commit is contained in:
@@ -141,10 +141,14 @@ abstract class AbstractCommonClubsModel
|
||||
|
||||
private function loadExternalReferenceAsObject($className, $value)
|
||||
{
|
||||
if(is_string($value) && preg_match('/^[0-9]+$/', $value))
|
||||
$value = (int) $value;
|
||||
|
||||
if(! is_int($value))
|
||||
throw new Exception('Reference with non-integer value');
|
||||
|
||||
$factory = $this->getFactoryOfClass($className);
|
||||
$factoryName = $this->getFactoryNameOfClass($className);
|
||||
$factory = new $factoryName();
|
||||
return $factory->loadById($value);
|
||||
}
|
||||
|
||||
@@ -157,7 +161,7 @@ abstract class AbstractCommonClubsModel
|
||||
* @param string $className
|
||||
* @return AbstractCommonClubsModelFactory
|
||||
*/
|
||||
private function getFactoryOfClass($className)
|
||||
private function getFactoryNameOfClass($className)
|
||||
{
|
||||
if(empty(self::CLASSNAME_MAP[$className]))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user