|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace POData\Providers\Metadata\Type; |
|
4
|
|
|
|
|
5
|
|
|
use POData\Common\NotImplementedException; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* Class VoidType |
|
9
|
|
|
* @package POData\Providers\Metadata\Type |
|
10
|
|
|
*/ |
|
11
|
|
|
class VoidType implements IType |
|
12
|
|
|
{ |
|
13
|
|
|
/** |
|
14
|
|
|
* Gets the type code |
|
15
|
|
|
* Note: implementation of IType::getTypeCode |
|
16
|
|
|
* |
|
17
|
|
|
* @return TypeCode |
|
18
|
|
|
*/ |
|
19
|
|
|
public function getTypeCode() |
|
20
|
|
|
{ |
|
21
|
|
|
return TypeCode::VOID; |
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* Checks this type (Void) is compatible with another type |
|
26
|
|
|
* Note: implementation of IType::isCompatibleWith |
|
27
|
|
|
* |
|
28
|
|
|
* @param IType $type Type to check compatibility |
|
29
|
|
|
* |
|
30
|
|
|
* @return boolean |
|
31
|
|
|
*/ |
|
32
|
|
|
public function isCompatibleWith(IType $type) |
|
33
|
|
|
{ |
|
34
|
|
|
return ($type->getTypeCode() == TypeCode::VOID); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* Validate a value in Astoria uri is in a format for this type |
|
39
|
|
|
* Note: implementation of IType::validate |
|
40
|
|
|
* |
|
41
|
|
|
* @param string $value The value to validate |
|
42
|
|
|
* @param string &$outValue The stripped form of $value that can |
|
43
|
|
|
* be used in PHP expressions |
|
44
|
|
|
* |
|
45
|
|
|
* @return boolean |
|
46
|
|
|
*/ |
|
47
|
|
|
public function validate($value, &$outValue) |
|
48
|
|
|
{ |
|
49
|
|
|
//No EDM void primitive type |
|
50
|
|
|
throw new NotImplementedException(); |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* Gets full name of this type in EDM namespace |
|
55
|
|
|
* Note: implementation of IType::getFullTypeName |
|
56
|
|
|
* |
|
57
|
|
|
* @return string |
|
58
|
|
|
*/ |
|
59
|
|
|
public function getFullTypeName() |
|
60
|
|
|
{ |
|
61
|
|
|
return 'System.Void'; |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* Converts the given string value to void type. |
|
66
|
|
|
* |
|
67
|
|
|
* @param string $stringValue value to convert |
|
68
|
|
|
* |
|
69
|
|
|
* @return void |
|
70
|
|
|
* |
|
71
|
|
|
* @throws NotImplementedException |
|
72
|
|
|
*/ |
|
73
|
|
|
public function convert($stringValue) |
|
74
|
|
|
{ |
|
75
|
|
|
throw new NotImplementedException(); |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* Convert the given value to a form that can be used in OData uri. |
|
80
|
|
|
* |
|
81
|
|
|
* @param string $value value to convert to OData |
|
82
|
|
|
* |
|
83
|
|
|
* @return void |
|
84
|
|
|
* |
|
85
|
|
|
* @throws NotImplementedException |
|
86
|
|
|
*/ |
|
87
|
|
|
public function convertToOData($value) |
|
88
|
|
|
{ |
|
89
|
|
|
throw new NotImplementedException(); |
|
90
|
|
|
} |
|
91
|
|
|
} |