src/Events/DatabaseBackedListener.php
protected function createInstanceViaLegacyFactory(CreateMetaModelEvent $event, $arrData)
    {
        $name = $arrData['tableName'];
        if (!isset($GLOBALS['METAMODELS']['factories'][$name])) {
            return false;
        }

        // @codingStandardsIgnoreStart
        @trigger_error('Creating MetaModel instances via global factories is deprecated.', E_USER_DEPRECATED);
        // @codingStandardsIgnoreEnd

        $factoryClass = $GLOBALS['METAMODELS']['factories'][$name];
        $event->setMetaModel(call_user_func_array(array($factoryClass, 'createInstance'), array($arrData)));

        return $event->getMetaModel() !== null;
    }
protected function createInstanceViaLegacyFactory(CreateMetaModelEvent $event, $arrData)
    {
        $name = $arrData['tableName'];
        if (!isset($GLOBALS['METAMODELS']['factories'][$name])) {
            return false;
        }

        // @codingStandardsIgnoreStart
        @trigger_error('Creating MetaModel instances via global factories is deprecated.', E_USER_DEPRECATED);
        // @codingStandardsIgnoreEnd

        $factoryClass = $GLOBALS['METAMODELS']['factories'][$name];
        $event->setMetaModel(call_user_func_array(array($factoryClass, 'createInstance'), array($arrData)));

        return $event->getMetaModel() !== null;
    }
Determines the correct factory from a metamodel table name and creates an instance using the factory.

@param CreateMetaModelEvent $event   The event.

@param array                $arrData The meta information for the MetaModel.

@return bool

@SuppressWarnings(PHPMD.Superglobals)
@SuppressWarnings(PHPMD.CamelCaseVariableName)