src/RepositoryTrait.php
public function removeOneBy(array $criteria, bool $flush = false)
    {
        $this->runManagerAction('remove', $this->findOneBy($criteria), $flush);
    }
public function removeOneBy(array $criteria, bool $flush = false)
    {
        $this->runManagerAction('remove', $this->findOneBy($criteria), $flush);
    }
Remove first object filtered by a set of criteria.

@param array $criteria
@param bool  $flush