protected function processCollectionType($collection, $collectionKeys) {
		$result = [];
		foreach ($collectionKeys as $collectionKey) {
			array_push($this->propertyPath, $collectionKey);

			$value = ObjectAccess::getProperty($collection, $collectionKey);
			$result[$collectionKey] = $this->processInternal($value);

			array_pop($this->propertyPath);
		}
		return $result;
	}
protected function processCollectionType($collection, $collectionKeys) {
		$result = [];
		foreach ($collectionKeys as $collectionKey) {
			array_push($this->propertyPath, $collectionKey);

			$value = ObjectAccess::getProperty($collection, $collectionKey);
			$result[$collectionKey] = $this->processInternal($value);

			array_pop($this->propertyPath);
		}
		return $result;
	}
protected function processCollectionType ( $ collection , $ collectionKeys ) { $ result = [ ] ; foreach ( $ collectionKeys as $ collectionKey ) { array_push ( $ this -> propertyPath , $ collectionKey ) ; $ value = ObjectAccess :: getProperty ( $ collection , $ collectionKey ) ; $ result [ $ collectionKey ] = $ this -> processInternal ( $ value ) ; array_pop ( $ this -> propertyPath ) ; } return $ result ; }
This method handles "collection types", which are DTOs and arrays.

Each individual property of those collection type is processed according
internal processing rules.
There might be MetaData content available for each property. Although those
are applied to each collection type, those work best when being applied
to Dto properties but not to array properties.

array(
0 => array(
'subject' => 'foo',
'content' => 'bar',
'resource' => 'http://localhost/me',
'resource$$' => 'MetaData for the "resource" property, which is "0.resource".', // good
),
'0$$' => 'MetaData for this object, which is "0".', // bad
)

This example shows that "resource" can be enhanced with MetaData easily because that
does not change the model layout significantly. Having an additional object attribute
in both, PHP and JavaScript doesn't change behavior.
On the other side, adding meta data to the array ('0$$') directly makes JsonEncode
convert the array to an object. Without the MetaData, the surrounding object gets
encoded to '[{"subject":"x" ... }]', with having the MetaData applied, the surrounding
object gets converted to '{"0":{},"0$$":"x"}'. Note that the encoded version of the
surrounding object in the first situation has square brackets indication an array,
the second situation has curly brackets indicating an array. So the output type of
of the surrounding object changes from array to object, just because the object meta
data feature is enabled.

MetaData needs to be configured separately. By default, no MetaData is attached.

@param $collection
@param $collectionKeys
@return array
This method handles collection types which are DTOs and arrays .