protected function processArray(array $array = null, $parentIdentifier, array $previousArray = null)
    {
        if ($previousArray !== null && is_array($previousArray['value'])) {
            $this->removeDeletedArrayEntries($array, $previousArray['value']);
        }

        if ($array === null) {
            return null;
        }

        $values = [];
        foreach ($array as $key => $value) {
            if ($value instanceof \DateTimeInterface) {
                $values[] = [
                    'type' => 'DateTime',
                    'index' => $key,
                    'value' => $this->processDateTime($value)
                ];
            } elseif ($value instanceof \SplObjectStorage) {
                throw new PersistenceException('SplObjectStorage instances in arrays are not supported - missing feature?!?', 1261048721);
            } elseif ($value instanceof \ArrayObject) {
                throw new PersistenceException('ArrayObject instances in arrays are not supported - missing feature?!?', 1283524345);
            } elseif (is_object($value)) {
                $values[] = [
                    'type' => $this->getType($value),
                    'index' => $key,
                    'value' => $this->processObject($value, $parentIdentifier)
                ];
            } elseif (is_array($value)) {
                $values[] = [
                    'type' => 'array',
                    'index' => $key,
                    'value' => $this->processNestedArray($parentIdentifier, $value)
                ];
            } else {
                $values[] = [
                    'type' => $this->getType($value),
                    'index' => $key,
                    'value' => $value
                ];
            }
        }

        return $values;
    }
protected function processArray(array $array = null, $parentIdentifier, array $previousArray = null)
    {
        if ($previousArray !== null && is_array($previousArray['value'])) {
            $this->removeDeletedArrayEntries($array, $previousArray['value']);
        }

        if ($array === null) {
            return null;
        }

        $values = [];
        foreach ($array as $key => $value) {
            if ($value instanceof \DateTimeInterface) {
                $values[] = [
                    'type' => 'DateTime',
                    'index' => $key,
                    'value' => $this->processDateTime($value)
                ];
            } elseif ($value instanceof \SplObjectStorage) {
                throw new PersistenceException('SplObjectStorage instances in arrays are not supported - missing feature?!?', 1261048721);
            } elseif ($value instanceof \ArrayObject) {
                throw new PersistenceException('ArrayObject instances in arrays are not supported - missing feature?!?', 1283524345);
            } elseif (is_object($value)) {
                $values[] = [
                    'type' => $this->getType($value),
                    'index' => $key,
                    'value' => $this->processObject($value, $parentIdentifier)
                ];
            } elseif (is_array($value)) {
                $values[] = [
                    'type' => 'array',
                    'index' => $key,
                    'value' => $this->processNestedArray($parentIdentifier, $value)
                ];
            } else {
                $values[] = [
                    'type' => $this->getType($value),
                    'index' => $key,
                    'value' => $value
                ];
            }
        }

        return $values;
    }
protected function processArray ( array $ array = null , $ parentIdentifier , array $ previousArray = null ) { if ( $ previousArray !== null && is_array ( $ previousArray [ 'value' ] ) ) { $ this -> removeDeletedArrayEntries ( $ array , $ previousArray [ 'value' ] ) ; } if ( $ array === null ) { return null ; } $ values = [ ] ; foreach ( $ array as $ key => $ value ) { if ( $ value instanceof \ DateTimeInterface ) { $ values [ ] = [ 'type' => 'DateTime' , 'index' => $ key , 'value' => $ this -> processDateTime ( $ value ) ] ; } elseif ( $ value instanceof \ SplObjectStorage ) { throw new PersistenceException ( 'SplObjectStorage instances in arrays are not supported - missing feature?!?' , 1261048721 ) ; } elseif ( $ value instanceof \ ArrayObject ) { throw new PersistenceException ( 'ArrayObject instances in arrays are not supported - missing feature?!?' , 1283524345 ) ; } elseif ( is_object ( $ value ) ) { $ values [ ] = [ 'type' => $ this -> getType ( $ value ) , 'index' => $ key , 'value' => $ this -> processObject ( $ value , $ parentIdentifier ) ] ; } elseif ( is_array ( $ value ) ) { $ values [ ] = [ 'type' => 'array' , 'index' => $ key , 'value' => $ this -> processNestedArray ( $ parentIdentifier , $ value ) ] ; } else { $ values [ ] = [ 'type' => $ this -> getType ( $ value ) , 'index' => $ key , 'value' => $ value ] ; } } return $ values ; }
Store an array as a set of records, with each array element becoming a
property named like the key and the value.

Note: Objects contained in the array will have a matching entry created,
the objects must be persisted elsewhere!

@param array $array The array to persist
@param string $parentIdentifier
@param array $previousArray the previously persisted state of the array
@return array An array with "flat" values representing the array
@throws PersistenceException
Store an array as a set of records with each array element becoming a property named like the key and the value .