Sulu\Bundle\MediaBundle\Collection\Manager\CollectionManager::move PHP Метод

move() публичный Метод

public move ( $id, $locale, $destinationId = null )
    public function move($id, $locale, $destinationId = null)
    {
        try {
            $collectionEntity = $this->collectionRepository->findCollectionById($id);
            if ($collectionEntity === null) {
                throw new CollectionNotFoundException($id);
            }
            $destinationEntity = null;
            if ($destinationId !== null) {
                $destinationEntity = $this->collectionRepository->findCollectionById($destinationId);
            }
            $collectionEntity->setParent($destinationEntity);
            $this->em->flush();
            return $this->getApiEntity($collectionEntity, $locale);
        } catch (DBALException $ex) {
            throw new CollectionNotFoundException($destinationId);
        }
    }