<?php
/**
 * Created by PhpStorm.
 * User: VillaJu
 * Date: 11/21/2015
 * Time: 8:29 AM
 */
abstract class ImportFromExcel extends ImportExcelFileToEntity
{
    abstract function doSave();
    public function save()
    {
        $this->_entity->query('START TRANSACTION;');

        if ($this->doSave()) {
            $this->_entity->query('COMMIT;');
            return true;
        }

        $this->_entity->query('ROLLBACK;');
        return false;
    }
}