-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dispatch events on import success / failure
- Loading branch information
1 parent
f73b2a1
commit 9cb7949
Showing
9 changed files
with
211 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © Fastbolt Schraubengroßhandels GmbH. | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Fastbolt\EntityImporter\Events; | ||
|
||
use DateTimeInterface; | ||
use Exception; | ||
use Fastbolt\EntityImporter\EntityImporterDefinition; | ||
|
||
class ImportFailureEvent | ||
{ | ||
/** | ||
* @var Exception | ||
*/ | ||
private Exception $exception; | ||
|
||
/** | ||
* @var EntityImporterDefinition|null | ||
*/ | ||
private ?EntityImporterDefinition $definition; | ||
|
||
/** | ||
* @var DateTimeInterface | ||
*/ | ||
private DateTimeInterface $importStart; | ||
|
||
/** | ||
* @param EntityImporterDefinition|null $definition | ||
* @param DateTimeInterface $importStart | ||
* @param Exception $exception | ||
*/ | ||
public function __construct( | ||
?EntityImporterDefinition $definition, | ||
DateTimeInterface $importStart, | ||
Exception $exception | ||
) { | ||
$this->definition = $definition; | ||
$this->importStart = $importStart; | ||
$this->exception = $exception; | ||
} | ||
|
||
/** | ||
* @return Exception | ||
*/ | ||
public function getException(): Exception | ||
{ | ||
return $this->exception; | ||
} | ||
|
||
/** | ||
* @return EntityImporterDefinition|null | ||
*/ | ||
public function getDefinition(): ?EntityImporterDefinition | ||
{ | ||
return $this->definition; | ||
} | ||
|
||
/** | ||
* @return DateTimeInterface | ||
*/ | ||
public function getImportStart(): DateTimeInterface | ||
{ | ||
return $this->importStart; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © Fastbolt Schraubengroßhandels GmbH. | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Fastbolt\EntityImporter\Events; | ||
|
||
use DateTimeInterface; | ||
use Fastbolt\EntityImporter\EntityImporterDefinition; | ||
use Fastbolt\EntityImporter\Types\ImportResult; | ||
|
||
class ImportSuccessEvent | ||
{ | ||
/** | ||
* @var ImportResult | ||
*/ | ||
private ImportResult $importResult; | ||
|
||
/** | ||
* @var EntityImporterDefinition | ||
*/ | ||
private EntityImporterDefinition $definition; | ||
|
||
/** | ||
* @var DateTimeInterface | ||
*/ | ||
private DateTimeInterface $importStart; | ||
|
||
/** | ||
* @param EntityImporterDefinition $definition | ||
* @param DateTimeInterface $importStart | ||
* @param ImportResult $importResult | ||
*/ | ||
public function __construct( | ||
EntityImporterDefinition $definition, | ||
DateTimeInterface $importStart, | ||
ImportResult $importResult | ||
) { | ||
$this->definition = $definition; | ||
$this->importStart = $importStart; | ||
$this->importResult = $importResult; | ||
} | ||
|
||
/** | ||
* @return ImportResult | ||
*/ | ||
public function getImportResult(): ImportResult | ||
{ | ||
return $this->importResult; | ||
} | ||
|
||
/** | ||
* @return EntityImporterDefinition | ||
*/ | ||
public function getDefinition(): EntityImporterDefinition | ||
{ | ||
return $this->definition; | ||
} | ||
|
||
/** | ||
* @return DateTimeInterface | ||
*/ | ||
public function getImportStart(): DateTimeInterface | ||
{ | ||
return $this->importStart; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Fastbolt\EntityImporter\Tests\Unit\Events; | ||
|
||
use Fastbolt\EntityImporter\Events\ImportSuccessEvent; | ||
use Fastbolt\TestHelpers\BaseTestCase; | ||
|
||
class ImportSuccessEventTest extends BaseTestCase { | ||
|
||
} |