1<?php
2
3namespace Sabre\VObject;
4
5use ArrayIterator;
6use LogicException;
7
8/**
9 * VObject ElementList.
10 *
11 * This class represents a list of elements. Lists are the result of queries,
12 * such as doing $vcalendar->vevent where there's multiple VEVENT objects.
13 *
14 * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
15 * @author Evert Pot (http://evertpot.com/)
16 * @license http://sabre.io/license/ Modified BSD License
17 */
18class ElementList extends ArrayIterator
19{
20    /* {{{ ArrayAccess Interface */
21
22    /**
23     * Sets an item through ArrayAccess.
24     *
25     * @param int   $offset
26     * @param mixed $value
27     */
28    public function offsetSet($offset, $value)
29    {
30        throw new LogicException('You can not add new objects to an ElementList');
31    }
32
33    /**
34     * Sets an item through ArrayAccess.
35     *
36     * This method just forwards the request to the inner iterator
37     *
38     * @param int $offset
39     */
40    public function offsetUnset($offset)
41    {
42        throw new LogicException('You can not remove objects from an ElementList');
43    }
44
45    /* }}} */
46}
47