public function setTranslation($key, $val, $lang) { // If it is a Mongo entity, convert it to its reference if ($val instanceof ZFE_Model_Mongo) { $val = $val->getReference(); } // If it is a DateTime, convert it to MongoDate if ($val instanceof DateTime) { $val = new MongoDate($val->getTimestamp()); } parent::setTranslation($key, $val, $lang); }