PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.13.1
GiveWP – Donation Plugin and Fundraising Platform v2.13.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
92 lines 1.4 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\Exceptions\ReferenceNodeNotFoundException;
6 use Give\Framework\FieldsAPI\Field;
7
8 interface Collection {
9
10 /**
11 * Fluently append nodes to the collection.
12 *
13 * @param Node ...$nodes
14 *
15 * @return $this
16 */
17 public function append( Node ...$nodes );
18
19 /**
20 * Fluently remove a named node.
21 *
22 * @param string $name
23 *
24 * @return mixed
25 */
26 public function remove( $name );
27
28 /**
29 * Get all the nodes.
30 *
31 * @return Node[]
32 */
33 public function all();
34
35 /**
36 * Count all the nodes.
37 *
38 * @return int
39 */
40 public function count();
41
42 /**
43 * Get a node’s index by its name.
44 *
45 * @param string $name
46 *
47 * @return int
48 */
49 public function getNodeIndexByName( $name );
50
51 /**
52 * Get a node by its name.
53 *
54 * @param string $name
55 *
56 * @return Node|Collection
57 */
58 public function getNodeByName( $name );
59
60 /**
61 * Get only the field nodes.
62 *
63 * @return Field[]
64 */
65 public function getFields();
66
67 /**
68 * @param string $siblingName
69 * @param Node $node
70 *
71 * @return $this
72 */
73 public function insertAfter( $siblingName, Node $node );
74
75 /**
76 * @param string $siblingName
77 * @param Node $node
78 *
79 * @return $this
80 */
81 public function insertBefore( $siblingName, Node $node );
82
83 /**
84 * Walk through each node in the collection
85 *
86 * @param callable $callback
87 *
88 * @return void
89 */
90 public function walk( callable $callback );
91 }
92