Newer
Older
namespace Breyta\Model;
use Breyta\AbstractMigration;
use Breyta\AdapterInterface;
class Migration
{
/** @var string */
public $file;
/** @var \DateTime */
public $executed;
/** @var string */
public $status;
/** @var string|array|Statement[] */
public $statements;
/** @var double */
public $executionTime;
public function __construct()
{
if (!empty($this->executed) && is_string($this->executed)) {
$this->executed = new \DateTime($this->executed, new \DateTimeZone('UTC'));
}
if (!empty($this->statements) && is_string($this->statements)) {
$this->statements = array_map(function ($data) {
return Statement::createInstance($data);
}, json_decode($this->statements, true));