Sulu\Bundle\MediaBundle\Collection\Manager\CollectionManager::modifyCollection PHP Method

modifyCollection() private method

Modified an exists collection.
private modifyCollection ( $data, $user ) : Collection
$data
$user
return Sulu\Bundle\MediaBundle\Api\Collection
    private function modifyCollection($data, $user)
    {
        $collection = $this->getById($data['id'], $data['locale']);
        $data['changer'] = $user;
        $data['changed'] = new \DateTime();
        $collection = $this->setDataToCollection($collection, $data);
        $collectionEntity = $collection->getEntity();
        $this->em->persist($collectionEntity);
        $this->em->flush();
        return $collection;
    }