/**
  * @param mixed $value
  * @param PropertyMetadata $property
  *
  * @return array|bool|float|int|string|null
  */
 public function normalize($value, $property)
 {
     $result = array();
     $itemProperty = $this->makeItemProperty($property);
     foreach ($value as $subKey => $subValue) {
         $result[$subKey] = $this->processor->normalizeProcess($this->normalizer, $subValue, $itemProperty);
     }
     return $result;
 }
예제 #2
0
 /**
  * {@inheritDoc}
  *
  * @param object $object
  * @return mixed
  */
 public function normalize($object)
 {
     $result = array();
     $className = ObjectHelper::getFullClassName($object);
     $metadata = $this->metadataFactory->getMetadataForClass($className);
     foreach ($metadata->getProperties() as $property) {
         if ($this->propertySkipper->shouldSkip($property)) {
             continue;
         }
         $value = ObjectHelper::expose($object, $property);
         $value = $this->dataProcessor->normalizeProcess($this, $value, $property);
         $result[$property->getSerializedName()] = $value;
     }
     return $result;
 }