protected function transfer($objectOrArray): array
	{
		$data = [];
		$errors = [];
		if (\is_object($objectOrArray))
		{
			$errors = $this->dtService->transfer($objectOrArray, $data, $this->mapper);
		}
		elseif (\is_array($objectOrArray))
		{
			foreach ($objectOrArray as $index => $itemObjectOrArray)
			{
				[$data[$index], $itemErrors] = $this->transfer($itemObjectOrArray);
				if (!empty($itemErrors))
				{
					$errors[$index] = $itemErrors;
				}
			}
		}
		else
		{
			$data = $objectOrArray;
		}
		return [$data, $errors];
	}
protected function transfer($objectOrArray): array
	{
		$data = [];
		$errors = [];
		if (\is_object($objectOrArray))
		{
			$errors = $this->dtService->transfer($objectOrArray, $data, $this->mapper);
		}
		elseif (\is_array($objectOrArray))
		{
			foreach ($objectOrArray as $index => $itemObjectOrArray)
			{
				[$data[$index], $itemErrors] = $this->transfer($itemObjectOrArray);
				if (!empty($itemErrors))
				{
					$errors[$index] = $itemErrors;
				}
			}
		}
		else
		{
			$data = $objectOrArray;
		}
		return [$data, $errors];
	}
protected function transfer ( $ objectOrArray ) : array { $ data = [ ] ; $ errors = [ ] ; if ( \ is_object ( $ objectOrArray ) ) { $ errors = $ this -> dtService -> transfer ( $ objectOrArray , $ data , $ this -> mapper ) ; } elseif ( \ is_array ( $ objectOrArray ) ) { foreach ( $ objectOrArray as $ index => $ itemObjectOrArray ) { [ $ data [ $ index ] , $ itemErrors ] = $ this -> transfer ( $ itemObjectOrArray ) ; if ( ! empty ( $ itemErrors ) ) { $ errors [ $ index ] = $ itemErrors ; } } } else { $ data = $ objectOrArray ; } return [ $ data , $ errors ] ; }
Tries to transfer data from specified object or array to multi-dimensional scalar array
@param mixed $objectOrArray
@return array tuple (<transfered data> , <errors encountered during transfer>)
Tries to transfer data from specified object or array to multi - dimensional scalar array