protected function normalizeStandardArrayProperty(
        array $source,
        $standardProperty,
        $objectClass = null,
        $parentKey = null
    ) {
        $normalized = [];

        foreach ($source as $key => $value) {

            // key may be present as values, when it is included just for order or presence,
            // defaults need to be filled in
            if (is_numeric($key) && ! is_array($value)) {
                $key   = $value;
                $value = [];
            }

            // if the value is 'true', the main property is assume to be the same as the key
            // (this is of limited use, but may make sense for export strategies)
            if (true === $value) {
                $value = $key;
            }

            // if value is just a string, it is the standard property
            if (is_string($value)) {
                $value = [
                    $standardProperty => $value,
                ];
            }

            if ($objectClass) {

                if (empty($value)) {
                    $value = [];
                }

                $value = $this->makeClearedDataObject($objectClass, $value, $parentKey ? $parentKey . ".{$key}" : null);
            }

            $normalized[ $key ] = $value;
        }

        return $normalized;
    }
protected function normalizeStandardArrayProperty(
        array $source,
        $standardProperty,
        $objectClass = null,
        $parentKey = null
    ) {
        $normalized = [];

        foreach ($source as $key => $value) {

            // key may be present as values, when it is included just for order or presence,
            // defaults need to be filled in
            if (is_numeric($key) && ! is_array($value)) {
                $key   = $value;
                $value = [];
            }

            // if the value is 'true', the main property is assume to be the same as the key
            // (this is of limited use, but may make sense for export strategies)
            if (true === $value) {
                $value = $key;
            }

            // if value is just a string, it is the standard property
            if (is_string($value)) {
                $value = [
                    $standardProperty => $value,
                ];
            }

            if ($objectClass) {

                if (empty($value)) {
                    $value = [];
                }

                $value = $this->makeClearedDataObject($objectClass, $value, $parentKey ? $parentKey . ".{$key}" : null);
            }

            $normalized[ $key ] = $value;
        }

        return $normalized;
    }
protected function normalizeStandardArrayProperty ( array $ source , $ standardProperty , $ objectClass = null , $ parentKey = null ) { $ normalized = [ ] ; foreach ( $ source as $ key => $ value ) { // key may be present as values, when it is included just for order or presence, // defaults need to be filled in if ( is_numeric ( $ key ) && ! is_array ( $ value ) ) { $ key = $ value ; $ value = [ ] ; } // if the value is 'true', the main property is assume to be the same as the key // (this is of limited use, but may make sense for export strategies) if ( true === $ value ) { $ value = $ key ; } // if value is just a string, it is the standard property if ( is_string ( $ value ) ) { $ value = [ $ standardProperty => $ value , ] ; } if ( $ objectClass ) { if ( empty ( $ value ) ) { $ value = [ ] ; } $ value = $ this -> makeClearedDataObject ( $ objectClass , $ value , $ parentKey ? $ parentKey . ".{$key}" : null ) ; } $ normalized [ $ key ] = $ value ; } return $ normalized ; }
Normalizes a standard array property.

This assumes sections such as list.columns, where keys are required designators.

@param array       $source
@param string      $standardProperty property to set for string values in normalized array
@param null|string $objectClass      dataobject FQN to interpret as
@param null|string $parentKey
@return array
Normalizes a standard array property .