PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 4.3.21
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v4.3.21
6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 3.6.66 All 195 releases
fluentform / framework / Foundation / HookReference.php

HookReference.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 4.3.21, at framework/Foundation/HookReference.php

47 lines 771 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\Framework\Foundation;
4
5 class HookReference
6 {
7 /**
8 * $ref reference for any hook
9 * @var null
10 */
11 private $ref = null;
12
13 /**
14 * construct the instance
15 * @param Application $app
16 * @param reference $ref
17 * @param string $key
18 */
19 public function __construct(Application $app, $ref, $key = null)
20 {
21 $this->app = $app;
22 $this->ref = $ref;
23 $this->key = $key;
24 }
25
26 /**
27 * Save the hook's handler reference
28 * @param string $key
29 * @return reference
30 */
31 public function saveReference($key = null)
32 {
33 // TODO: Add exception
34 $this->app->bindInstance($key ? $key : $this->key, $this->ref);
35
36 return $this->ref;
37 }
38
39 /**
40 * Get the reference
41 * @return reference
42 */
43 public function reference()
44 {
45 return $this->ref;
46 }
47 }