1 | <?php |
||
7 | class Meta |
||
8 | { |
||
9 | /** |
||
10 | * Meta type |
||
11 | * @var string |
||
12 | */ |
||
13 | protected $type; |
||
14 | |||
15 | protected $object_id; |
||
16 | |||
17 | protected $key; |
||
18 | |||
19 | /** |
||
20 | * @param string $type Meta type |
||
21 | * @param int|string $object_id ID of the object metadata is for |
||
22 | * @param string $key [description] |
||
23 | */ |
||
24 | public function __construct($type, $object_id, $key) |
||
30 | |||
31 | /** |
||
32 | * Get the single meta data |
||
33 | * |
||
34 | * @return mixed |
||
35 | */ |
||
36 | public function get($key = '') |
||
44 | |||
45 | /** |
||
46 | * Get all meta data |
||
47 | * |
||
48 | * @return Collection |
||
49 | */ |
||
50 | public function all() |
||
54 | |||
55 | /** |
||
56 | * Set the meta value |
||
57 | * |
||
58 | * @param mixed $value |
||
59 | * @param string $prev_value [description] |
||
60 | * @return bool True on success, false on failure |
||
61 | */ |
||
62 | public function set($value, $prev_value = '') |
||
66 | |||
67 | /** |
||
68 | * Add metadata for the specified object |
||
69 | * |
||
70 | * @param mixed $value The value to add |
||
71 | * @param [type] $unique [description] |
||
|
|||
72 | * |
||
73 | * @return int|false The meta ID on success, false on failure. |
||
74 | */ |
||
75 | public function add($value, $unique = false) |
||
79 | |||
80 | /** |
||
81 | * Delete the meta data |
||
82 | * |
||
83 | * Deletes all meta data for the key, if provided, optionally filtered by |
||
84 | * a previous value. |
||
85 | * If no key was provided, all meta data for the object is deleted. |
||
86 | * |
||
87 | * @param string $value The old value to delete. |
||
88 | * This is only necessary when deleting a specific value |
||
89 | * from an object which has multiple values for the key. |
||
90 | * |
||
91 | * @return bool True on success, false on failure |
||
92 | */ |
||
93 | public function delete($value = '') |
||
97 | |||
98 | /** |
||
99 | * Determine if a meta key is set for a given object |
||
100 | * |
||
101 | * @return bool True of the key is set, false if not. |
||
102 | */ |
||
103 | public function exists() |
||
107 | |||
108 | /** |
||
109 | * Get the object_id |
||
110 | * |
||
111 | * @return int|string |
||
112 | */ |
||
113 | public function getObjectId() |
||
117 | |||
118 | /** |
||
119 | * |
||
120 | */ |
||
121 | public function __get($property) |
||
125 | |||
126 | public function __toString() |
||
130 | } |
||
131 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.