@@ 8-42 (lines=35) @@ | ||
5 | use TreeHouse\IoBundle\Scrape\ScrapedItemBag; |
|
6 | use TreeHouse\IoBundle\Scrape\Scraper; |
|
7 | ||
8 | class FailedItemEvent extends ItemEvent |
|
9 | { |
|
10 | /** |
|
11 | * @var string |
|
12 | */ |
|
13 | protected $reason; |
|
14 | ||
15 | /** |
|
16 | * @param Scraper $scraper |
|
17 | * @param ScrapedItemBag $item |
|
18 | * @param string $reason |
|
19 | */ |
|
20 | public function __construct(Scraper $scraper, ScrapedItemBag $item, $reason) |
|
21 | { |
|
22 | parent::__construct($scraper, $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\Scrape\ScrapedItemBag; |
|
6 | use TreeHouse\IoBundle\Scrape\Scraper; |
|
7 | ||
8 | class InvalidItemEvent extends ItemEvent |
|
9 | { |
|
10 | /** |
|
11 | * @var string |
|
12 | */ |
|
13 | protected $reason; |
|
14 | ||
15 | /** |
|
16 | * @param Scraper $scraper |
|
17 | * @param ScrapedItemBag $item |
|
18 | * @param string $reason |
|
19 | */ |
|
20 | public function __construct(Scraper $scraper, ScrapedItemBag $item, $reason) |
|
21 | { |
|
22 | parent::__construct($scraper, $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\Scrape\ScrapedItemBag; |
|
6 | use TreeHouse\IoBundle\Scrape\Scraper; |
|
7 | ||
8 | class SkippedItemEvent extends ItemEvent |
|
9 | { |
|
10 | /** |
|
11 | * @var string |
|
12 | */ |
|
13 | protected $reason; |
|
14 | ||
15 | /** |
|
16 | * @param Scraper $scraper |
|
17 | * @param ScrapedItemBag $item |
|
18 | * @param string $reason |
|
19 | */ |
|
20 | public function __construct(Scraper $scraper, ScrapedItemBag $item, $reason) |
|
21 | { |
|
22 | parent::__construct($scraper, $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\Scrape\ScrapedItemBag; |
|
7 | use TreeHouse\IoBundle\Scrape\Scraper; |
|
8 | ||
9 | class SuccessItemEvent extends ItemEvent |
|
10 | { |
|
11 | /** |
|
12 | * @var SourceInterface |
|
13 | */ |
|
14 | protected $result; |
|
15 | ||
16 | /** |
|
17 | * @param Scraper $scraper |
|
18 | * @param ScrapedItemBag $item |
|
19 | * @param SourceInterface $result |
|
20 | */ |
|
21 | public function __construct(Scraper $scraper, ScrapedItemBag $item, SourceInterface $result) |
|
22 | { |
|
23 | parent::__construct($scraper, $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 |