PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 3.21.1
GiveWP – Donation Plugin and Fundraising Platform v3.21.1
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / Framework / FieldsAPI / Contracts / Collection.php
Collection.php
97 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\Framework\FieldsAPI\Contracts;
4
5 use Give\Framework\FieldsAPI\Field;
6
7 interface Collection
8 {
9 /**
10 * @since 2.10.2
11 *
12 * Fluently append nodes to the collection.
13 *
14 * @return $this do not add return type until PHP 7.4 is minimum
15 */
16 public function append(Node ...$nodes);
17
18 /**
19 * Fluently remove a named node.
20 *
21 * @since 2.10.2
22 *
23 * @return mixed
24 */
25 public function remove(string $name);
26
27 /**
28 * Get all the nodes.
29 *
30 * @since 2.10.2
31 *
32 * @return Node[]
33 */
34 public function all(): array;
35
36 /**
37 * Count all the nodes.
38 *
39 * @since 2.10.2
40 *
41 * @return int
42 */
43 public function count(): int;
44
45 /**
46 * Get a node’s index by its name.
47 *
48 * @since 2.10.2
49 *
50 * @return int|null
51 */
52 public function getNodeIndexByName(string $name);
53
54 /**
55 * Get a node by its name.
56 *
57 * @since 2.10.2
58 *
59 * @return Node|Collection
60 */
61 public function getNodeByName(string $name);
62
63 /**
64 * Get only the field nodes.
65 *
66 * @return Field[]
67 */
68 public function getFields(): array;
69
70 /**
71 * Inserts the given noe after the node with the given name.
72 *
73 * @since 2.10.2
74 *
75 * @return $this
76 */
77 public function insertAfter(string $siblingName, Node $node);
78
79 /**
80 * Inserts the given noe before the node with the given name.
81 *
82 * @since 2.10.2
83 *
84 * @return $this
85 */
86 public function insertBefore(string $siblingName, Node $node);
87
88 /**
89 * Walk through each node in the collection
90 *
91 * @since 2.10.2
92 *
93 * @return void
94 */
95 public function walk(callable $callback);
96 }
97