Skip to content

Commit

Permalink
Updated model selection with namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
coreation committed Apr 24, 2014
1 parent 02d3fbf commit 7cc3608
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Tdt/Input/EMLP/JobExecuter.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,20 @@ private function getExecuter($model)
return $model;
}

$executer = 'Tdt\\Input\\ELMP\\' . get_class($model);
$class = get_class($model);

$pieces = explode('\\', $class);

// Convert the model name to ucfirst namespace conventions
$model_name = '';

foreach ($pieces as $class_piece) {
$model_name .= ucfirst($class_piece) . '\\';
}

$model_name = rtrim($model_name, '\\');

$executer = 'Tdt\\Input\\EMLP\\' . $model_name;

if (!class_exists($executer)) {

Expand Down

0 comments on commit 7cc3608

Please sign in to comment.