public function doUnKnowUpdate(PhrasesEntity $word) { // invalid setting if ($word->getStatus() != $this->marker->getStatus()) { throw new EngRuntimeException("status doesn't match!"); } $newFailureCount = $word->getFailure() + 1; if ($newFailureCount >= $this->marker->getFailure()) { $newStatus = $this->getNextStatusWhenFail($word->getStatus()); if ($newStatus != $word->getStatus()) { $word->setStatus($newStatus); $word->setSuccess(0); $word->setFailure(0); } else { $word->setFailure($newFailureCount); } } else { $word->setFailure($newFailureCount); } }