| @@ 8-42 (lines=35) @@ | ||
| 5 | use TreeHouse\IoBundle\Import\Feed\FeedItemBag; |
|
| 6 | use TreeHouse\IoBundle\Import\Importer\Importer; |
|
| 7 | ||
| 8 | class FailedItemEvent extends ItemEvent |
|
| 9 | { |
|
| 10 | /** |
|
| 11 | * @var string |
|
| 12 | */ |
|
| 13 | protected $reason; |
|
| 14 | ||
| 15 | /** |
|
| 16 | * @param Importer $importer |
|
| 17 | * @param FeedItemBag $item |
|
| 18 | * @param string $reason |
|
| 19 | */ |
|
| 20 | public function __construct(Importer $importer, FeedItemBag $item, $reason) |
|
| 21 | { |
|
| 22 | parent::__construct($importer, $item); |
|
| 23 | ||
| 24 | $this->reason = $reason; |
|
| 25 | } |
|
| 26 | ||
| 27 | /** |
|
| 28 | * @param string $reason |
|
| 29 | */ |
|
| 30 | public function setReason($reason) |
|
| 31 | { |
|
| 32 | $this->reason = $reason; |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @return string |
|
| 37 | */ |
|
| 38 | public function getReason() |
|
| 39 | { |
|
| 40 | return $this->reason; |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||
| @@ 8-42 (lines=35) @@ | ||
| 5 | use TreeHouse\IoBundle\Import\Feed\FeedItemBag; |
|
| 6 | use TreeHouse\IoBundle\Import\Importer\Importer; |
|
| 7 | ||
| 8 | class InvalidItemEvent extends ItemEvent |
|
| 9 | { |
|
| 10 | /** |
|
| 11 | * @var string |
|
| 12 | */ |
|
| 13 | protected $reason; |
|
| 14 | ||
| 15 | /** |
|
| 16 | * @param Importer $importer |
|
| 17 | * @param FeedItemBag $item |
|
| 18 | * @param string $reason |
|
| 19 | */ |
|
| 20 | public function __construct(Importer $importer, FeedItemBag $item, $reason) |
|
| 21 | { |
|
| 22 | parent::__construct($importer, $item); |
|
| 23 | ||
| 24 | $this->reason = $reason; |
|
| 25 | } |
|
| 26 | ||
| 27 | /** |
|
| 28 | * @param string $reason |
|
| 29 | */ |
|
| 30 | public function setReason($reason) |
|
| 31 | { |
|
| 32 | $this->reason = $reason; |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @return string |
|
| 37 | */ |
|
| 38 | public function getReason() |
|
| 39 | { |
|
| 40 | return $this->reason; |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||
| @@ 8-42 (lines=35) @@ | ||
| 5 | use TreeHouse\IoBundle\Import\Feed\FeedItemBag; |
|
| 6 | use TreeHouse\IoBundle\Import\Importer\Importer; |
|
| 7 | ||
| 8 | class SkippedItemEvent extends ItemEvent |
|
| 9 | { |
|
| 10 | /** |
|
| 11 | * @var string |
|
| 12 | */ |
|
| 13 | protected $reason; |
|
| 14 | ||
| 15 | /** |
|
| 16 | * @param Importer $importer |
|
| 17 | * @param FeedItemBag $item |
|
| 18 | * @param string $reason |
|
| 19 | */ |
|
| 20 | public function __construct(Importer $importer, FeedItemBag $item, $reason) |
|
| 21 | { |
|
| 22 | parent::__construct($importer, $item); |
|
| 23 | ||
| 24 | $this->reason = $reason; |
|
| 25 | } |
|
| 26 | ||
| 27 | /** |
|
| 28 | * @param string $reason |
|
| 29 | */ |
|
| 30 | public function setReason($reason) |
|
| 31 | { |
|
| 32 | $this->reason = $reason; |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @return string |
|
| 37 | */ |
|
| 38 | public function getReason() |
|
| 39 | { |
|
| 40 | return $this->reason; |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||
| @@ 9-43 (lines=35) @@ | ||
| 6 | use TreeHouse\IoBundle\Import\Importer\Importer; |
|
| 7 | use TreeHouse\IoBundle\Model\SourceInterface; |
|
| 8 | ||
| 9 | class SuccessItemEvent extends ItemEvent |
|
| 10 | { |
|
| 11 | /** |
|
| 12 | * @var SourceInterface |
|
| 13 | */ |
|
| 14 | protected $result; |
|
| 15 | ||
| 16 | /** |
|
| 17 | * @param Importer $importer |
|
| 18 | * @param FeedItemBag $item |
|
| 19 | * @param SourceInterface $result |
|
| 20 | */ |
|
| 21 | public function __construct(Importer $importer, FeedItemBag $item, SourceInterface $result) |
|
| 22 | { |
|
| 23 | parent::__construct($importer, $item); |
|
| 24 | ||
| 25 | $this->result = $result; |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @param SourceInterface $result The result |
|
| 30 | */ |
|
| 31 | public function setResult($result) |
|
| 32 | { |
|
| 33 | $this->result = $result; |
|
| 34 | } |
|
| 35 | ||
| 36 | /** |
|
| 37 | * @return SourceInterface |
|
| 38 | */ |
|
| 39 | public function getResult() |
|
| 40 | { |
|
| 41 | return $this->result; |
|
| 42 | } |
|
| 43 | } |
|
| 44 | ||
| @@ 9-43 (lines=35) @@ | ||
| 6 | use TreeHouse\IoBundle\Import\Importer\Importer; |
|
| 7 | use TreeHouse\IoBundle\Model\SourceInterface; |
|
| 8 | ||
| 9 | class HandledItemEvent extends ItemEvent |
|
| 10 | { |
|
| 11 | /** |
|
| 12 | * @var SourceInterface |
|
| 13 | */ |
|
| 14 | protected $source; |
|
| 15 | ||
| 16 | /** |
|
| 17 | * @param Importer $importer |
|
| 18 | * @param FeedItemBag $item |
|
| 19 | * @param SourceInterface $source |
|
| 20 | */ |
|
| 21 | public function __construct(Importer $importer, FeedItemBag $item, SourceInterface $source) |
|
| 22 | { |
|
| 23 | parent::__construct($importer, $item); |
|
| 24 | ||
| 25 | $this->source = $source; |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @param SourceInterface $source The result |
|
| 30 | */ |
|
| 31 | public function setSource($source) |
|
| 32 | { |
|
| 33 | $this->source = $source; |
|
| 34 | } |
|
| 35 | ||
| 36 | /** |
|
| 37 | * @return SourceInterface |
|
| 38 | */ |
|
| 39 | public function getSource() |
|
| 40 | { |
|
| 41 | return $this->source; |
|
| 42 | } |
|
| 43 | } |
|
| 44 | ||