/**
  * Clean states for a ReportModel
  *
  * @param ReportModel $model
  */
 protected function cleanStates($model)
 {
     $key = $model->getWorkflowIdentifier();
     $result = $this->em->getRepository('Lexik\\Bundle\\WorkflowBundle\\Entity\\ModelState')->findBy(array('workflowIdentifier' => $key));
     foreach ($result as $entity) {
         $this->em->remove($entity);
     }
     $this->em->flush();
 }