public function persist($object, $flush = true)
    {
        if ($object->getId()) {
            $this->update($object, $flush);
        } else {
            $this->create($object, $flush);
        }
    }