You are here

public function Reflection::extract in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-hydrator/src/Reflection.php \Zend\Hydrator\Reflection::extract()

Extract values from an object

Parameters

object $object:

Return value

array

Overrides ExtractionInterface::extract

File

vendor/zendframework/zend-hydrator/src/Reflection.php, line 29

Class

Reflection

Namespace

Zend\Hydrator

Code

public function extract($object) {
  $result = [];
  foreach (self::getReflProperties($object) as $property) {
    $propertyName = $this
      ->extractName($property
      ->getName(), $object);
    if (!$this->filterComposite
      ->filter($propertyName)) {
      continue;
    }
    $value = $property
      ->getValue($object);
    $result[$propertyName] = $this
      ->extractValue($propertyName, $value, $object);
  }
  return $result;
}