1 | <?php |
||
15 | abstract class StandardAbstract |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * DateTime default format |
||
20 | */ |
||
21 | const DATETIME_FORMAT = \DateTime::RFC2822; |
||
22 | |||
23 | /** |
||
24 | * Supported format |
||
25 | */ |
||
26 | const SYNTAX_FORMAT = ''; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $mandatoryFields = array(); |
||
32 | |||
33 | /** |
||
34 | * @var \FeedIo\Rule\DateTimeBuilder |
||
35 | */ |
||
36 | protected $dateTimeBuilder; |
||
37 | |||
38 | /** |
||
39 | * @param \FeedIo\Rule\DateTimeBuilder $dateTimeBuilder |
||
40 | */ |
||
41 | 55 | public function __construct(DateTimeBuilder $dateTimeBuilder) |
|
45 | |||
46 | /** |
||
47 | * Tells if the parser can handle the feed or not |
||
48 | * @param Document $document |
||
49 | * @return boolean |
||
50 | */ |
||
51 | abstract public function canHandle(Document $document); |
||
52 | |||
53 | /** |
||
54 | * @return \FeedIo\FormatterInterface |
||
55 | */ |
||
56 | abstract public function getFormatter(); |
||
57 | |||
58 | /** |
||
59 | * @return string |
||
60 | */ |
||
61 | 15 | public function getDefaultDateFormat() |
|
65 | |||
66 | /** |
||
67 | * @return array |
||
68 | */ |
||
69 | 11 | public function getMandatoryFields() |
|
73 | |||
74 | /** |
||
75 | * Returns the Format supported by the standard (XML, JSON, Text...) |
||
76 | * @return string |
||
77 | */ |
||
78 | 9 | public function getSyntaxFormat() |
|
82 | |||
83 | } |
||
84 |