I have an object named Property, how can I convert that to array
/**
* @Route("/property/{id}/pictures/download_all", name="property_zip_files_and_download", methods={"GET"})
*/
public function zipFilesAndDownloadAction(Property $property)
{
$pictures = $property->pictures;
$compressPath = $this->get('some_service.property.picture_compress')->compress($pictures);
//some code for download...
....
}
How can I convert the pictures to array and pass it to my service? Can anyone please help me out here