Exemplo n.º 1
0
 /**
  * Updates a mark.
  *
  * @param Mark   $mark
  * @param string $value
  */
 public function updateMark(Mark $mark, $value)
 {
     $oldMark = $mark->getValue();
     $mark->setValue($value);
     $this->om->flush();
     // First of all update older mark events so as result would be new value
     $this->updateNewMarkEventResult($mark->getUser(), $mark->getId(), $value);
     // Then create new mark event to log update
     $newMarkEvent = new LogResultsNewMarkEvent($mark, $oldMark);
     $this->dispatcher->dispatch('log', $newMarkEvent);
 }