src/EntityRepositoryTrait.php
public function updateEntity($entity, $flush = true)
    {
        $this->validateEntity($entity, __METHOD__);

        return $this->persist($entity, $flush);
    }
public function updateEntity($entity, $flush = true)
    {
        $this->validateEntity($entity, __METHOD__);

        return $this->persist($entity, $flush);
    }
Tells the EntityManager to make an instance managed and persistent.

@param mixed $entity
@param bool  $flush

@return mixed
@throws \Doctrine\ORM\ORMInvalidArgumentException
@throws \Doctrine\ORM\OptimisticLockException
@throws \Xloit\Bridge\Doctrine\ORM\Exception\InvalidArgumentException