Form/JsonToMenuTreeTransformer.php
public function reverseTransform($jsonMenuNodes)
    {
        // TODO add exception
        if ($jsonMenuNodes instanceof Collection && $jsonMenuNodes->count() === 0) {
            return new ArrayCollection();
        }
        $this->allNodes = [];

        // TODO handle no node
        $firstNode = json_decode($jsonMenuNodes->first())[0];

        // Only handle the first collection item which contain all tree
        $menuItemsArray = $this->recursiveNodeHandling(json_decode($jsonMenuNodes->first()));

        // Remove delta which is not present anymore


        return new ArrayCollection($menuItemsArray);
    }
public function reverseTransform($jsonMenuNodes)
    {
        // TODO add exception
        if ($jsonMenuNodes instanceof Collection && $jsonMenuNodes->count() === 0) {
            return new ArrayCollection();
        }
        $this->allNodes = [];

        // TODO handle no node
        $firstNode = json_decode($jsonMenuNodes->first())[0];

        // Only handle the first collection item which contain all tree
        $menuItemsArray = $this->recursiveNodeHandling(json_decode($jsonMenuNodes->first()));

        // Remove delta which is not present anymore


        return new ArrayCollection($menuItemsArray);
    }
Used on form validation, to transform menu nodes in real MenuItem
@param mixed $jsonMenuNodes
@return null|Collection
@throws \Exception