3 declare(strict_types=1);
33 private static $discriminatorClasses = [
34 'Point' => GeoJsonPointModel::class,
52 if (is_null($this->type)) {
54 $data = $this->
raw(self::FIELD_TYPE);
58 $this->type = (string) $data;
75 if (is_object($value) && isset($value->$fieldName)) {
77 $discriminatorValue = $value->$fieldName;
78 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
79 return self::$discriminatorClasses[$discriminatorValue];
82 if (is_array($value) && isset($value[$fieldName])) {
84 $discriminatorValue = $value[$fieldName];
85 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
86 return self::$discriminatorClasses[$discriminatorValue];
91 $type = GeoJsonModel::class;