protected function recover($step)
    {
        $itemsCollection = $this->matchItems('restore', $step);

        if (count($itemsCollection) > 1 && array_key_exists('references', $step->dsl)) {
            throw new \Exception("Can not execute Trash restore because multiple items match, and a references section is specified in the dsl. References can be set when only 1 item matches");
        }

        $locations = array();
        $trashService = $this->repository->getTrashService();
        foreach ($itemsCollection as $key => $item) {
            $locations[] = $trashService->recover($item);
        }

        $this->setReferences(new LocationCollection($locations), $step);

        return $itemsCollection;
    }
protected function recover($step)
    {
        $itemsCollection = $this->matchItems('restore', $step);

        if (count($itemsCollection) > 1 && array_key_exists('references', $step->dsl)) {
            throw new \Exception("Can not execute Trash restore because multiple items match, and a references section is specified in the dsl. References can be set when only 1 item matches");
        }

        $locations = array();
        $trashService = $this->repository->getTrashService();
        foreach ($itemsCollection as $key => $item) {
            $locations[] = $trashService->recover($item);
        }

        $this->setReferences(new LocationCollection($locations), $step);

        return $itemsCollection;
    }
protected function recover ( $ step ) { $ itemsCollection = $ this -> matchItems ( 'restore' , $ step ) ; if ( count ( $ itemsCollection ) > 1 && array_key_exists ( 'references' , $ step -> dsl ) ) { throw new \ Exception ( "Can not execute Trash restore because multiple items match, and a references section is specified in the dsl. References can be set when only 1 item matches" ) ; } $ locations = array ( ) ; $ trashService = $ this -> repository -> getTrashService ( ) ; foreach ( $ itemsCollection as $ key => $ item ) { $ locations [ ] = $ trashService -> recover ( $ item ) ; } $ this -> setReferences ( new LocationCollection ( $ locations ) , $ step ) ; return $ itemsCollection ; }
Handles the trash-restore migration action

@todo support handling of restoration to custom locations
Handles the trash - restore migration action