mirror of
https://github.com/jbcr/ezmigrationbundle.git
synced 2026-03-24 17:02:15 +01:00
30 lines
766 B
PHP
30 lines
766 B
PHP
<?php
|
|
|
|
namespace Kaliop\eZMigrationBundle\Core\Executor;
|
|
|
|
use Kaliop\eZMigrationBundle\API\Value\MigrationStep;
|
|
use Kaliop\eZMigrationBundle\API\ExecutorInterface;
|
|
|
|
abstract class AbstractExecutor implements ExecutorInterface
|
|
{
|
|
protected $supportedStepTypes = array();
|
|
|
|
public function supportedTypes()
|
|
{
|
|
return $this->supportedStepTypes;
|
|
}
|
|
|
|
/**
|
|
* IT IS MANDATORY TO OVERRIDE THIS IN SUBCLASSES
|
|
* @param MigrationStep $step
|
|
* @return mixed
|
|
* @throws \Exception
|
|
*/
|
|
public function execute(MigrationStep $step)
|
|
{
|
|
if (!in_array($step->type, $this->supportedStepTypes)) {
|
|
throw new \Exception("Something is wrong! Executor can not work on step of type '{$step->type}'");
|
|
}
|
|
}
|
|
}
|