# fluentform/1.2.4/framework/Foundation/HookReference.php

Fluent Forms – Customizable Contact Forms, Survey, Quiz, &amp; Conversational Form Builder, version 1.2.4. 47 lines.

- Page: https://pluginprobe.com/plugins/fluentform/1.2.4/code/framework/Foundation/HookReference.php
- Raw: https://pluginprobe.com/plugins/fluentform/1.2.4/raw/framework/Foundation/HookReference.php
- Modified: 2018-01-04T13:51:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluentform/1.2.4/code/framework/Foundation/HookReference.php#L10-L20`.

```php
<?php

namespace FluentForm\Framework\Foundation;

class HookReference
{
	/**
	 * $ref reference for any hook
	 * @var null
	 */
	private $ref = null;

	/**
	 * construct the instance
	 * @param Application $app
	 * @param reference $ref
	 * @param string $key
	 */
	public function __construct(Application $app, $ref, $key = null)
	{
		$this->app = $app;
		$this->ref = $ref;
		$this->key = $key;
	}

	/**
	 * Save the hook's handler reference
	 * @param  string $key
	 * @return reference
	 */
	public function saveReference($key = null)
	{
		// TODO: Add exception
		$this->app->bindInstance($key ? $key : $this->key, $this->ref);

		return $this->ref;
	}

	/**
	 * Get the reference
	 * @return reference
	 */
	public function reference()
	{
		return $this->ref;
	}
}
```
