| 1 |
<?php defined('ABSPATH') or die; |
| 2 |
|
| 3 |
/* This file is property of Pixel Grade Media. You may NOT copy, or redistribute |
| 4 |
* it. Please see the license that came with your copy for more information. |
| 5 |
*/ |
| 6 |
|
| 7 |
/** |
| 8 |
* @package pixcustomify |
| 9 |
* @category core |
| 10 |
* @author Pixel Grade Team |
| 11 |
* @copyright (c) 2013, Pixel Grade Media |
| 12 |
*/ |
| 13 |
interface PixCustomifyMeta { |
| 14 |
|
| 15 |
/** |
| 16 |
* @param string meta key |
| 17 |
* @return boolean true if key exists, false otherwise |
| 18 |
*/ |
| 19 |
function has($key); |
| 20 |
|
| 21 |
/** |
| 22 |
* @return mixed value or default |
| 23 |
*/ |
| 24 |
function get($key, $default = null); |
| 25 |
|
| 26 |
/** |
| 27 |
* @return static $this |
| 28 |
*/ |
| 29 |
function set($key, $value); |
| 30 |
|
| 31 |
/** |
| 32 |
* Set the key if it's not already set. |
| 33 |
* |
| 34 |
* @param string key |
| 35 |
* @param string value |
| 36 |
*/ |
| 37 |
function ensure($key, $value); |
| 38 |
|
| 39 |
/** |
| 40 |
* If the key is currently a non-array value it will be converted to an |
| 41 |
* array maintaning the previous value (along with the new one). |
| 42 |
* |
| 43 |
* @param string name |
| 44 |
* @param mixed value |
| 45 |
* @return static $this |
| 46 |
*/ |
| 47 |
function add($name, $value); |
| 48 |
|
| 49 |
/** |
| 50 |
* @return array all metadata as array |
| 51 |
*/ |
| 52 |
function metadata_array(); |
| 53 |
|
| 54 |
/** |
| 55 |
* Shorthand for a calling set on multiple keys. |
| 56 |
* |
| 57 |
* @return static $this |
| 58 |
*/ |
| 59 |
function overwritemeta($overwrites); |
| 60 |
|
| 61 |
} # interface |
| 62 |
|