1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This software package is licensed under AGPL or Commercial license. |
5
|
|
|
* |
6
|
|
|
* @package maslosoft/mangan |
7
|
|
|
* @licence AGPL or Commercial |
8
|
|
|
* @copyright Copyright (c) Piotr Masełkowski <[email protected]> |
9
|
|
|
* @copyright Copyright (c) Maslosoft |
10
|
|
|
* @copyright Copyright (c) Others as mentioned in code |
11
|
|
|
* @link https://maslosoft.com/mangan/ |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Maslosoft\Mangan\Meta; |
15
|
|
|
|
16
|
|
|
use Maslosoft\Addendum\Collections\Meta; |
17
|
|
|
use Maslosoft\Addendum\Interfaces\AnnotatedInterface; |
18
|
|
|
use Maslosoft\Addendum\Options\MetaOptions; |
19
|
|
|
use Maslosoft\Mangan\Options\ManganMetaOptions; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Mangan metadata container class |
23
|
|
|
* @author Piotr Maselkowski <pmaselkowski at gmail.com> |
24
|
|
|
*/ |
25
|
|
|
class ManganMeta extends Meta |
26
|
|
|
{ |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Create instance of Metadata specifically designed for Mangan |
30
|
|
|
* @param string|object|AnnotatedInterface $model |
31
|
|
|
* @param MetaOptions $options |
32
|
|
|
* @return ManganMeta |
33
|
|
|
*/ |
34
|
215 |
|
public static function create($model, MetaOptions $options = null) |
35
|
|
|
{ |
36
|
215 |
|
if (null === $options) |
37
|
|
|
{ |
38
|
215 |
|
$options = new ManganMetaOptions(); |
39
|
|
|
} |
40
|
215 |
|
return parent::create($model, $options); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Get document type meta |
45
|
|
|
* @return DocumentTypeMeta |
46
|
|
|
*/ |
47
|
165 |
|
public function type() |
48
|
|
|
{ |
49
|
165 |
|
return parent::type(); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Get field by name |
54
|
|
|
* @param string $name |
55
|
|
|
* @return DocumentPropertyMeta |
56
|
|
|
*/ |
57
|
126 |
|
public function field($name) |
58
|
|
|
{ |
59
|
126 |
|
return parent::field($name); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* Get method meta data |
64
|
|
|
* @param type $name |
65
|
|
|
* @return DocumentMethodMeta |
66
|
|
|
*/ |
67
|
|
|
public function method($name) |
68
|
|
|
{ |
69
|
|
|
return parent::method($name); |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
} |
73
|
|
|
|