diff --git a/src/FM/ClassificationBundle/Classifier/ResultPersistingClassifier.php b/src/FM/ClassificationBundle/Classifier/ResultPersistingClassifier.php index 0685b7b..ef41d40 100644 --- a/src/FM/ClassificationBundle/Classifier/ResultPersistingClassifier.php +++ b/src/FM/ClassificationBundle/Classifier/ResultPersistingClassifier.php @@ -94,6 +94,10 @@ protected function persistResult($input, $output, $confidence, $expected = null) $classifyResult->setClassifier($this->classifierName); $classifyResult->setExpected($expected); + if (null !== $expected) { + $classifyResult->setDatetimeTrained(new \DateTime()); + } + // if we have an existing record, update it's score, otherwise insert if ($existingClassifyResult = $this->doctrine->getRepository('FMClassificationBundle:ClassifyResult')->findOneByHash($classifyResult->getHash())) { $existingClassifyResult->setOutput($output); @@ -134,6 +138,8 @@ public function teach($input, $expected) $classifyResult->incrementWeight(); $classifyResult->setScore(null); + + $classifyResult->setDatetimeTrained(new \DateTime()); } $this->doctrine->getManager()->flush($classifyResults);