| 1 |
<?php |
| 2 |
/** |
| 3 |
* A strict interface for Charitable_Fields models. |
| 4 |
* |
| 5 |
* @package Charitable/Classes/Charitable_Fields_Interface |
| 6 |
* @version 1.5.0 |
| 7 |
* @author Eric Daams |
| 8 |
* @copyright Copyright (c) 2022, Studio 164a |
| 9 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 10 |
*/ |
| 11 |
|
| 12 |
// Exit if accessed directly. |
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; |
| 15 |
} |
| 16 |
|
| 17 |
if ( ! class_exists( 'Charitable_Fields_Interface' ) ) : |
| 18 |
|
| 19 |
/** |
| 20 |
* Charitable_Fields_Interface |
| 21 |
* |
| 22 |
* @since 1.5.0 |
| 23 |
*/ |
| 24 |
interface Charitable_Fields_Interface { |
| 25 |
|
| 26 |
/** |
| 27 |
* Get the set value for a particular field. |
| 28 |
* |
| 29 |
* @since 1.5.0 |
| 30 |
* |
| 31 |
* @param string $field The field to get a value for. |
| 32 |
* @return mixed |
| 33 |
*/ |
| 34 |
public function get( $field ); |
| 35 |
|
| 36 |
/** |
| 37 |
* Check whether a particular field is registered. |
| 38 |
* |
| 39 |
* @since 1.5.0 |
| 40 |
* |
| 41 |
* @param string $field The field to check for. |
| 42 |
* @return boolean |
| 43 |
*/ |
| 44 |
public function has( $field ); |
| 45 |
|
| 46 |
/** |
| 47 |
* Check whether a particular field has a callback for getting the value. |
| 48 |
* |
| 49 |
* @since 1.5.0 |
| 50 |
* |
| 51 |
* @param string $field The field to check for. |
| 52 |
* @return boolean |
| 53 |
*/ |
| 54 |
public function has_value_callback( $field ); |
| 55 |
} |
| 56 |
|
| 57 |
endif; |
| 58 |
|