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