1 | <?php |
||
10 | class Acf |
||
11 | { |
||
12 | /** |
||
13 | * The class' single instance. |
||
14 | * |
||
15 | * @var \Samrap\Acf\Acf |
||
16 | */ |
||
17 | private static $instance; |
||
18 | |||
19 | /** |
||
20 | * The behavior instances. |
||
21 | * |
||
22 | * @var \Samrap\Acf\Behaviors\BehaviorInterface[] |
||
23 | */ |
||
24 | private $behaviors = []; |
||
25 | |||
26 | /** |
||
27 | * The available macros defined. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | private $macros = []; |
||
32 | |||
33 | /** |
||
34 | * Private constructor to prevent instantiation. |
||
35 | * |
||
36 | * @codeCoverageIgnore The class cannot be instantiated. |
||
37 | */ |
||
38 | private function __construct() |
||
42 | |||
43 | /** |
||
44 | * Get the single instance of this object. |
||
45 | * |
||
46 | * @return \Samrap\Acf\Acf |
||
47 | */ |
||
48 | private static function getInstance() |
||
56 | |||
57 | /** |
||
58 | * Return a new builder instance for a field call. |
||
59 | * |
||
60 | * @param string $name |
||
61 | * @param int $id |
||
62 | * @return \Samrap\Acf\Fluent\Builder |
||
63 | */ |
||
64 | public static function field($name, $id = null) |
||
71 | |||
72 | /** |
||
73 | * Return a new builder instance for a subfield call. |
||
74 | * |
||
75 | * @param string $name |
||
76 | * @return \Samrap\Acf\Fluent\Builder |
||
77 | */ |
||
78 | public static function subField($name) |
||
84 | |||
85 | /** |
||
86 | * Return a new builder instance for an option field call. |
||
87 | * |
||
88 | * @param string $name |
||
89 | * @return \Samrap\Acf\Fluent\Builder |
||
90 | */ |
||
91 | public static function option($name) |
||
98 | |||
99 | /** |
||
100 | * Add a macro to the ACF builder. |
||
101 | * |
||
102 | * @param string $method |
||
103 | * @param callable $operation |
||
104 | * @return void |
||
105 | */ |
||
106 | public static function macro($method, $operation) |
||
110 | |||
111 | /** |
||
112 | * Return a builder instance with the given behavior. |
||
113 | * |
||
114 | * @param string $behavior |
||
115 | * @return \Samrap\Acf\Fluent\Builder |
||
116 | */ |
||
117 | private function getBuilder($behavior) |
||
126 | } |
||
127 |