1
|
|
|
<?php |
2
|
|
|
namespace POData\Common\Messages; |
3
|
|
|
|
4
|
|
|
trait configuration |
5
|
|
|
{ |
6
|
|
|
/** |
7
|
|
|
* Error message to show when both page size and |
8
|
|
|
* result collection size are specified. |
9
|
|
|
* |
10
|
|
|
* @return string The message |
11
|
|
|
*/ |
12
|
|
|
public static function configurationMaxResultAndPageSizeMutuallyExclusive() |
13
|
|
|
{ |
14
|
|
|
return 'Specification of \'entity set page size\' is mutually exclusive with the specification of \'maximum result per collection\' in configuration'; |
15
|
|
|
} |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Format a message to show error when configuration expects a |
19
|
|
|
* name as resource set name but it is not. |
20
|
|
|
* |
21
|
|
|
* @param string $name The unresolved name |
22
|
|
|
* |
23
|
|
|
* @return string The formatted message |
24
|
|
|
*/ |
25
|
|
|
public static function configurationResourceSetNameNotFound($name) |
26
|
|
|
{ |
27
|
|
|
return "The given name '$name' was not found in the entity sets"; |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Format a message to show error when a function argument expected to |
32
|
|
|
* EntitySetRights enum value but it is not. |
33
|
|
|
* |
34
|
|
|
* @param string $argument The argument name |
35
|
|
|
* @param string $functionName The function name |
36
|
|
|
* |
37
|
|
|
* @return string The formatted message |
38
|
|
|
*/ |
39
|
|
|
public static function configurationRightsAreNotInRange($argument, $functionName) |
40
|
|
|
{ |
41
|
|
|
return "The argument '$argument' of '$functionName' should be EntitySetRights enum value"; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* A message to show error when service developer disabled count request and |
46
|
|
|
* client requested for count. |
47
|
|
|
* |
48
|
|
|
* @return string The message |
49
|
|
|
*/ |
50
|
|
|
public static function configurationCountNotAccepted() |
51
|
|
|
{ |
52
|
|
|
return 'The ability of the data service to return row count information is disabled. To enable this functionality, set the ServiceConfiguration.AcceptCountRequests property to true.'; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Message to show error when query processor found $select clause but which is |
58
|
|
|
* disabled by the service developer. |
59
|
|
|
* |
60
|
|
|
* @return string The message |
61
|
|
|
*/ |
62
|
|
|
public static function configurationProjectionsNotAccepted() |
63
|
|
|
{ |
64
|
|
|
return 'The ability to use the $select query option to define a projection in a data service query is disabled. To enable this functionality, call ServiceConfiguration::setAcceptProjectionRequests method with argument as true.'; |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
|