| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  | /* | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  |  * This file is part of the feed-io package. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * (c) Alexandre Debril <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  * For the full copyright and license information, please view the LICENSE | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |  * file that was distributed with this source code. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | namespace FeedIo\Feed; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  | use FeedIo\Feed\Node\Category; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | use FeedIo\Feed\Node\CategoryInterface; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  | use FeedIo\Feed\Node\Element; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  | use FeedIo\Feed\Node\ElementIterator; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  | use FeedIo\Feed\Node\ElementInterface; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  | class Node implements NodeInterface | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |      * @var \ArrayIterator | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |     protected $elements; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |      | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |      * @var \ArrayIterator | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |     protected $categories; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |      * @var string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |     protected $title; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |      * @var string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |     protected $publicId; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |      * @var string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |     protected $description; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |      * @var \DateTime | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |     protected $lastModified; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |      * @var string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |     protected $link; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 | 83 |  |     public function __construct() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 | 83 |  |         $this->elements = new \ArrayIterator(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 | 83 |  |         $this->categories = new \ArrayIterator(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 | 83 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |      * @param  string $name  element name | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |      * @param  string $value element value | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |      * @return $this | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 | 11 |  |     public function set($name, $value) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 | 11 |  |         $element = $this->newElement(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 | 11 |  |         $element->setName($name); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 | 11 |  |         $element->setValue($value); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 | 11 |  |         $this->addElement($element); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 | 11 |  |         return $this; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  |      | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  |      * returns node's categories | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  |      * @return \ArrayIterator | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 85 |  |  |      */ | 
            
                                                                        
                            
            
                                    
            
            
                | 86 | 9 |  |     public function getCategories() | 
            
                                                                        
                            
            
                                    
            
            
                | 87 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 88 | 9 |  |         return $this->categories; | 
            
                                                                        
                            
            
                                    
            
            
                | 89 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 |  |  |      * @return \Generator | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 | 2 |  |     public function getCategoriesGenerator() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 | 2 |  |         foreach( $this->categories as $category ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 | 2 |  |             yield $category->getlabel(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 |  |  |      * adds a category to the node | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  |      * @param \FeedIo\Feed\Node\CategoryInterface $category | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 |  |  |      * @return $this | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 | 11 |  |     public function addCategory(CategoryInterface $category) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 109 | 11 |  |         $this->categories->append($category); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 110 |  |  |          | 
            
                                                                                                            
                            
            
                                    
            
            
                | 111 | 11 |  |         return $this; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 112 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 113 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 114 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 115 |  |  |      * returns a new CategoryInterface | 
            
                                                                                                            
                            
            
                                    
            
            
                | 116 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 117 |  |  |      * @return \FeedIo\Feed\Node\CategoryInterface | 
            
                                                                                                            
                            
            
                                    
            
            
                | 118 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 119 | 5 |  |     public function newCategory() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 120 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 121 | 5 |  |         return new Category(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 122 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 123 |  |  |      | 
            
                                                                                                            
                            
            
                                    
            
            
                | 124 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 125 |  |  |      * @return ElementInterface | 
            
                                                                                                            
                            
            
                                    
            
            
                | 126 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 127 | 20 |  |     public function newElement() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 128 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 129 | 20 |  |         return new Element(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 130 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 131 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 132 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 133 |  |  |      * @param  string $name element name | 
            
                                                                                                            
                            
            
                                    
            
            
                | 134 |  |  |      * @return mixed | 
            
                                                                                                            
                            
            
                                    
            
            
                | 135 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 136 | 4 |  |     public function getValue($name) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 137 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 138 | 4 |  |         foreach ($this->getElementIterator($name) as $element) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 139 | 4 |  |             return $element->getValue(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 140 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 141 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 142 | 1 |  |         return; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 143 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 144 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 145 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 146 |  |  |      * @param  string          $name element name | 
            
                                                                                                            
                            
            
                                    
            
            
                | 147 |  |  |      * @return ElementIterator | 
            
                                                                                                            
                            
            
                                    
            
            
                | 148 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 149 | 14 |  |     public function getElementIterator($name) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 150 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 151 | 14 |  |         return new ElementIterator($this->elements, $name); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 152 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 153 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 154 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 155 |  |  |      * @param  string  $name element name | 
            
                                                                                                            
                            
            
                                    
            
            
                | 156 |  |  |      * @return boolean true if the element exists | 
            
                                                                                                            
                            
            
                                    
            
            
                | 157 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 158 | 4 |  |     public function hasElement($name) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 159 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 160 | 4 |  |         $filter = $this->getElementIterator($name); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 161 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 162 | 4 |  |         return $filter->count() > 0; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 163 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 164 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 165 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 166 |  |  |      * @param  ElementInterface $element | 
            
                                                                                                            
                            
            
                                    
            
            
                | 167 |  |  |      * @return $this | 
            
                                                                                                            
                            
            
                                    
            
            
                | 168 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 169 | 23 |  |     public function addElement(ElementInterface $element) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 170 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 171 | 23 |  |         $this->elements->append($element); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 172 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 173 | 23 |  |         return $this; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 174 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 175 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 176 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 177 |  |  |      * Returns all the item's optional elements | 
            
                                                                                                            
                            
            
                                    
            
            
                | 178 |  |  |      * @return \ArrayIterator | 
            
                                                                                                            
                            
            
                                    
            
            
                | 179 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 180 | 5 |  |     public function getAllElements() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 181 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 182 | 5 |  |         return $this->elements; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 183 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 184 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 185 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 186 |  |  |      * Returns the item's optional elements tag names | 
            
                                                                                                            
                            
            
                                    
            
            
                | 187 |  |  |      * @return array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 188 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 189 | 7 |  |     public function listElements() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 190 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 191 | 7 |  |         foreach ($this->elements as $element) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 192 | 4 |  |             yield ($element->getName()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 193 | 7 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 194 | 7 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 195 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 196 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 197 |  |  |      * @return \Generator | 
            
                                                                                                            
                            
            
                                    
            
            
                | 198 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 199 | 2 |  |     public function getElementsGenerator() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 200 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 201 | 2 |  |         $elements = $this->getAllElements(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 202 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 203 | 2 |  |         foreach( $elements as $element ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 204 | 2 |  |             yield $element->getName() => $element->getValue(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 205 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 206 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 207 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 208 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 209 |  |  |      * @return string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 210 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 211 | 16 |  |     public function getTitle() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 212 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 213 | 16 |  |         return $this->title; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 214 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 215 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 216 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 217 |  |  |      * @param  string $title | 
            
                                                                                                            
                            
            
                                    
            
            
                | 218 |  |  |      * @return $this | 
            
                                                                                                            
                            
            
                                    
            
            
                | 219 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 220 | 16 |  |     public function setTitle($title) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 221 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 222 | 16 |  |         $this->title = $title; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 223 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 224 | 16 |  |         return $this; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 225 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 226 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 227 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 228 |  |  |      * @return string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 229 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 230 | 8 |  |     public function getPublicId() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 231 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 232 | 8 |  |         return $this->publicId; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 233 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 234 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 235 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 236 |  |  |      * @param  string $publicId | 
            
                                                                                                            
                            
            
                                    
            
            
                | 237 |  |  |      * @return $this | 
            
                                                                                                            
                            
            
                                    
            
            
                | 238 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 239 | 10 |  |     public function setPublicId($publicId) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 240 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 241 | 10 |  |         $this->publicId = $publicId; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 242 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 243 | 10 |  |         return $this; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 244 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 245 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 246 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 247 |  |  |      * @return string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 248 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 249 | 8 |  |     public function getDescription() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 250 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 251 | 8 |  |         return $this->description; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 252 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 253 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 254 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 255 |  |  |      * @param  string $description | 
            
                                                                                                            
                            
            
                                    
            
            
                | 256 |  |  |      * @return $this | 
            
                                                                                                            
                            
            
                                    
            
            
                | 257 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 258 | 11 |  |     public function setDescription($description) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 259 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 260 | 11 |  |         $this->description = $description; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 261 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 262 | 11 |  |         return $this; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 263 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 264 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 265 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 266 |  |  |      * @return \DateTime | 
            
                                                                                                            
                            
            
                                    
            
            
                | 267 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 268 | 15 |  |     public function getLastModified() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 269 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 270 | 15 |  |         return $this->lastModified; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 271 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 272 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 273 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 274 |  |  |      * @param  \DateTime $lastModified | 
            
                                                                                                            
                            
            
                                    
            
            
                | 275 |  |  |      * @return $this | 
            
                                                                                                            
                            
            
                                    
            
            
                | 276 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 277 | 18 |  |     public function setLastModified(\DateTime $lastModified) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 278 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 279 | 18 |  |         $this->lastModified = $lastModified; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 280 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 281 | 18 |  |         return $this; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 282 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 283 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 284 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 285 |  |  |      * @return string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 286 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 287 | 13 |  |     public function getLink() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 288 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 289 | 13 |  |         return $this->link; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 290 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 291 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 292 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 293 |  |  |      * @param  string $link | 
            
                                                                                                            
                            
            
                                    
            
            
                | 294 |  |  |      * @return $this | 
            
                                                                                                            
                            
            
                                    
            
            
                | 295 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 296 | 15 |  |     public function setLink($link) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 297 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 298 | 15 |  |         $this->link = $link; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 299 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 300 | 15 |  |         return $this; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 301 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 302 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 303 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 304 |  |  |      * @return array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 305 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 306 | 1 |  |     public function toArray() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 307 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 308 | 1 |  |         $properties = get_object_vars($this); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 309 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 310 | 1 |  |         $properties['elements'] = iterator_to_array($this->getElementsGenerator()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 311 | 1 |  |         $properties['categories'] = iterator_to_array($this->getCategoriesGenerator()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 312 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 313 | 1 |  |         return $properties; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 314 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 315 |  |  |  | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 316 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 317 |  |  |  |