original_string: protected function isDeletable($object): bool
      {
          $em = $this->getEntityManager();
          $em->beginTransaction();
          try {
              // if an object is softdeleteable, then set 'deletedAt' first, so that a 'hard-delete' will be attempted.
              if ($object instanceof SoftDeleteableInterface) {
                  $object->setDeletedAt(new \DateTime());
              }
              $em->remove($object);
              $em->flush();
              $em->rollback();
              return true;
          } catch (ForeignKeyConstraintViolationException $exception) {
              $em->rollback();
              return false;
          }
      }
code: protected function isDeletable($object): bool
      {
          $em = $this->getEntityManager();
          $em->beginTransaction();
          try {
              // if an object is softdeleteable, then set 'deletedAt' first, so that a 'hard-delete' will be attempted.
              if ($object instanceof SoftDeleteableInterface) {
                  $object->setDeletedAt(new \DateTime());
              }
              $em->remove($object);
              $em->flush();
              $em->rollback();
              return true;
          } catch (ForeignKeyConstraintViolationException $exception) {
              $em->rollback();
              return false;
          }
      }
code_tokens: protected function isDeletable ( $ object ) : bool { $ em = $ this -> getEntityManager ( ) ; $ em -> beginTransaction ( ) ; try { // if an object is softdeleteable, then set 'deletedAt' first, so that a 'hard-delete' will be attempted. if ( $ object instanceof SoftDeleteableInterface ) { $ object -> setDeletedAt ( new \ DateTime ( ) ) ; } $ em -> remove ( $ object ) ; $ em -> flush ( ) ; $ em -> rollback ( ) ; return true ; } catch ( ForeignKeyConstraintViolationException $ exception ) { $ em -> rollback ( ) ; return false ; } }
docstring: Tries to delete an object without actually deleting it.
  Returns false if ForeignKeyConstraintViolationException would be thrown; true otherwise.
docstring_tokens: Tries to delete an object without actually deleting it . Returns false if ForeignKeyConstraintViolationException would be thrown ; true otherwise .