public function toArray()
    {
        $attribute_values = [ self::OBJECT_TYPE => $this->getType()->getPrefix() ];

        foreach ($this->value_holder_map as $attribute_name => $value_holder) {
            $attribute_value = $value_holder->getValue();

            if (is_object($attribute_value) && is_callable([ $attribute_value, 'toArray' ])) {
                $attribute_values[$attribute_name] = $attribute_value->toArray();
            } else {
                $attribute_values[$attribute_name] = $value_holder->toNative();
            }
        }

        return $attribute_values;
    }
public function toArray()
    {
        $attribute_values = [ self::OBJECT_TYPE => $this->getType()->getPrefix() ];

        foreach ($this->value_holder_map as $attribute_name => $value_holder) {
            $attribute_value = $value_holder->getValue();

            if (is_object($attribute_value) && is_callable([ $attribute_value, 'toArray' ])) {
                $attribute_values[$attribute_name] = $attribute_value->toArray();
            } else {
                $attribute_values[$attribute_name] = $value_holder->toNative();
            }
        }

        return $attribute_values;
    }
public function toArray ( ) { $ attribute_values = [ self :: OBJECT_TYPE => $ this -> getType ( ) -> getPrefix ( ) ] ; foreach ( $ this -> value_holder_map as $ attribute_name => $ value_holder ) { $ attribute_value = $ value_holder -> getValue ( ) ; if ( is_object ( $ attribute_value ) && is_callable ( [ $ attribute_value , 'toArray' ] ) ) { $ attribute_values [ $ attribute_name ] = $ attribute_value -> toArray ( ) ; } else { $ attribute_values [ $ attribute_name ] = $ value_holder -> toNative ( ) ; } } return $ attribute_values ; }
Returns an array representation of a entity's current value state.

@return array
Returns an array representation of a entity s current value state .