Update Recursive.php

In plans make this class as a real service for Symfony.
Added ability for work with common arrays and an entities of Doctrine