-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCustomField.php
More file actions
44 lines (37 loc) · 733 Bytes
/
CustomField.php
File metadata and controls
44 lines (37 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace PayTech;
use Exception;
use PayTech\Utils\Serializer;
/**
*
* @author PapiHack
* @since 07/2020
*
*/
abstract class CustomField
{
private static $data = [];
public static function push($data = [])
{
self::$data = $data;
}
public static function set($name, $value)
{
self::$data[$name] = $value;
}
public static function find($name)
{
if (array_key_exists($name, self::$data))
{
return self::$data[$name];
}
else
{
throw new Exception('The '.$name.' key doesn\'t exist !');
}
}
public static function retrieve()
{
return new Serializer(self::$data);
}
}