|
@@ -60,11 +60,6 @@ abstract class LuDbo implements \JsonSerializable {
|
60
|
60
|
return $obj;
|
61
|
61
|
}
|
62
|
62
|
|
63
|
|
- public static function endsWith($haystack, $needle) {
|
64
|
|
- return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0
|
65
|
|
- && strpos($haystack, $needle, $temp) !== false);
|
66
|
|
- }
|
67
|
|
-
|
68
|
63
|
public static function deserializeValue($value, $type) {
|
69
|
64
|
if (is_null($value)) {
|
70
|
65
|
return null;
|
|
@@ -96,7 +91,7 @@ abstract class LuDbo implements \JsonSerializable {
|
96
|
91
|
else if ($type == "mixed") {
|
97
|
92
|
return $value;
|
98
|
93
|
}
|
99
|
|
- else if (self::endsWith($type, "[]")) {
|
|
94
|
+ else if (LuStringUtils::endsWith($type, "[]")) {
|
100
|
95
|
if (!is_array($value)) {
|
101
|
96
|
throw new LuDboDeserializeException("Invalid array value");
|
102
|
97
|
}
|