1 | <?php |
||
18 | abstract class AbstractEntity |
||
19 | { |
||
20 | /** |
||
21 | * @param \stdClass|array|null $parameters |
||
22 | */ |
||
23 | public function __construct($parameters = null) |
||
35 | |||
36 | /** |
||
37 | * @param array $parameters |
||
38 | */ |
||
39 | public function build(array $parameters) |
||
49 | |||
50 | /** |
||
51 | * @return array |
||
52 | */ |
||
53 | public function toArray() |
||
70 | |||
71 | /** |
||
72 | * @param string|null $date DateTime string |
||
73 | * |
||
74 | * @return string|null DateTime in ISO8601 format |
||
75 | */ |
||
76 | protected static function convertDateTime($date) |
||
87 | |||
88 | /** |
||
89 | * @param string $str Snake case string |
||
90 | * |
||
91 | * @return string Camel case string |
||
92 | */ |
||
93 | protected static function convertToCamelCase($str) |
||
101 | |||
102 | /** |
||
103 | * @param $str Camel case string |
||
104 | * |
||
105 | * @return string Snake case string |
||
106 | */ |
||
107 | protected static function convertToSnakeCase($str) |
||
111 | } |
||
112 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: