|
| 1 | +<?php |
| 2 | + |
| 3 | +/* This file is part of the Phalcon Framework. |
| 4 | + * |
| 5 | + * (c) Phalcon Team <[email protected]> |
| 6 | + * |
| 7 | + * For the full copyright and license information, please view the LICENSE.txt |
| 8 | + * file that was distributed with this source code. |
| 9 | + */ |
| 10 | +namespace Phalcon\Collection; |
| 11 | + |
| 12 | +/** |
| 13 | + * Phalcon\Collection\CollectionInterface |
| 14 | + * |
| 15 | + * Interface for Phalcon\Collection class |
| 16 | + */ |
| 17 | +interface CollectionInterface |
| 18 | +{ |
| 19 | + |
| 20 | + /** |
| 21 | + * @param string $element |
| 22 | + * @return mixed |
| 23 | + */ |
| 24 | + public function __get(string $element); |
| 25 | + |
| 26 | + /** |
| 27 | + * @param string $element |
| 28 | + * @return bool |
| 29 | + */ |
| 30 | + public function __isset(string $element): bool; |
| 31 | + |
| 32 | + /** |
| 33 | + * @param string $element |
| 34 | + * @param mixed $value |
| 35 | + * @return void |
| 36 | + */ |
| 37 | + public function __set(string $element, $value); |
| 38 | + |
| 39 | + /** |
| 40 | + * @param string $element |
| 41 | + * @return void |
| 42 | + */ |
| 43 | + public function __unset(string $element); |
| 44 | + |
| 45 | + /** |
| 46 | + * @return void |
| 47 | + */ |
| 48 | + public function clear(); |
| 49 | + |
| 50 | + /** |
| 51 | + * @param string $element |
| 52 | + * @param mixed $defaultValue |
| 53 | + * @param string $cast |
| 54 | + * @return mixed |
| 55 | + */ |
| 56 | + public function get(string $element, $defaultValue = null, string $cast = null); |
| 57 | + |
| 58 | + /** |
| 59 | + * @param bool $insensitive |
| 60 | + * @return array |
| 61 | + */ |
| 62 | + public function getKeys(bool $insensitive = true): array; |
| 63 | + |
| 64 | + /** |
| 65 | + * @return array |
| 66 | + */ |
| 67 | + public function getValues(): array; |
| 68 | + |
| 69 | + /** |
| 70 | + * @param string $element |
| 71 | + * @return bool |
| 72 | + */ |
| 73 | + public function has(string $element): bool; |
| 74 | + |
| 75 | + /** |
| 76 | + * @param array $data |
| 77 | + * @return void |
| 78 | + */ |
| 79 | + public function init(array $data = array()); |
| 80 | + |
| 81 | + /** |
| 82 | + * @param string $element |
| 83 | + * @return void |
| 84 | + */ |
| 85 | + public function remove(string $element); |
| 86 | + |
| 87 | + /** |
| 88 | + * @param string $element |
| 89 | + * @param mixed $value |
| 90 | + * @return void |
| 91 | + */ |
| 92 | + public function set(string $element, $value); |
| 93 | + |
| 94 | + /** |
| 95 | + * @return array |
| 96 | + */ |
| 97 | + public function toArray(): array; |
| 98 | + |
| 99 | + /** |
| 100 | + * @param int $options |
| 101 | + * @return string |
| 102 | + */ |
| 103 | + public function toJson(int $options = 79): string; |
| 104 | +} |
0 commit comments