N98\Magento\Command\System\Cron\RunCommand::getCallbackFromRunConfigModel PHP Метод

getCallbackFromRunConfigModel() приватный Метод

private getCallbackFromRunConfigModel ( string $runConfigModel, string $jobCode ) : array
$runConfigModel string
$jobCode string
Результат array
    private function getCallbackFromRunConfigModel($runConfigModel, $jobCode)
    {
        if (!preg_match(self::REGEX_RUN_MODEL, $runConfigModel, $runMatches)) {
            throw new RuntimeException(sprintf('Invalid model/method definition "%s" for job "%s", expecting "model/class::method".', $runConfigModel, $jobCode));
        }
        list(, $runModel, $runMethod) = $runMatches;
        unset($runMatches);
        $model = Mage::getModel($runModel);
        if (false === $model) {
            throw new RuntimeException(sprintf('Failed to create new "%s" model for job "%s"', $runModel, $jobCode));
        }
        $callback = array($model, $runMethod);
        $callableName = sprintf("%s::%s", $runModel, $runMethod);
        if (!$model || !is_callable($callback, false, $callableName)) {
            throw new RuntimeException(sprintf('Invalid callback: %s for job "%s"', $callableName, $jobCode));
        }
        return array($callback, $callableName);
    }