private function encodeProperty(array
$dataType, mixed
$property) { switch ($dataType['type'
]) { case ScalarValueType::TYPE_BOOL:
case ScalarValueType::TYPE_FLOAT:
case ScalarValueType::TYPE_INT:
case ScalarValueType::TYPE_STRING:
return $property;
case EntityType::TYPE:
case EntityCollectionType::TYPE:
return $this->
encodeEntity($dataType,
$property);
case ObjectType::TYPE:
if (\
is_array($dataType['data'
]) && !
empty($dataType['data'
])) { return $this->
encodeType($dataType['data'
],
$property);
} return $property;
case ArrayType::TYPE:
return $this->
encodeArray($dataType,
$property);
default:
throw new \
RuntimeException('Unknown EventDataType: ' .
$dataType['type'
]);
} }