-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathItemInterface.php
79 lines (68 loc) · 2.01 KB
/
ItemInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
declare(strict_types=1);
namespace FeedIo\Feed;
use FeedIo\Feed\Item\MediaInterface;
/**
* Describes an Item instance
*
* an item holds three types of properties :
* - basic values inherited from the NodeInterface like title, description, URL
* - MediaInterface instances for medias like videos, images and podcasts
* - ElementInterface instances for nodes not related to a known property of the ItemInterface instance
*
* ElementInterface instances are accessed using two methods :
*
* - ItemInterface::getElementIterator($name). Use it to read an array of elements or if you need to get an ElementInterface instance
* - ItemInterface::getValue($name). use it to get the element's v lue
*
*/
interface ItemInterface extends NodeInterface
{
/**
* adds $media to the object's attributes
*
* @param MediaInterface $media
* @return ItemInterface
*/
public function addMedia(MediaInterface $media): ItemInterface;
/**
* returns the current object's medias
*
* @return iterable
*/
public function getMedias(): iterable;
/**
* returns true if at least one MediaInterface exists in the object's attributes
*
* @return boolean
*/
public function hasMedia(): bool;
/**
* returns a new MediaInterface
*
* @return MediaInterface
*/
public function newMedia(): MediaInterface;
/**
* Returns the item's summary. Valid for JSONFeed and Atom formats only
*
* @return string|null
*/
public function getSummary(): ?string;
/**
* @param string|null $summary
* @return ItemInterface
*/
public function setSummary(string $summary = null): ItemInterface;
/**
* Returns the item's content. Valid for JSONFeed and Atom formats only
*
* @return string|null
*/
public function getContent(): ?string;
/**
* @param string|null $content
* @return ItemInterface
*/
public function setContent(string $content = null): ItemInterface;
}