public function Save($blnForceInsert = false, $blnForceUpdate = false) { $this->intSuggestionWordCount = NarroString::WordCount($this->strSuggestionValue); $this->intSuggestionCharCount = mb_strlen($this->strSuggestionValue); $this->strSuggestionValueMd5 = md5($this->strSuggestionValue); if (!isset($this->blnIsImported)) { $this->blnIsImported = false; } if (!$this->__blnRestored || $blnForceInsert) { $this->dttCreated = QDateTime::Now(); } else { $this->dttModified = QDateTime::Now(); } parent::Save($blnForceInsert, $blnForceUpdate); /** * Update all context infos with the has suggestion property */ $arrContextInfo = NarroContextInfo::QueryArray(QQ::AndCondition(QQ::Equal(QQN::NarroContextInfo()->Context->TextId, $this->intTextId), QQ::Equal(QQN::NarroContextInfo()->LanguageId, $this->intLanguageId), QQ::Equal(QQN::NarroContextInfo()->HasSuggestions, 0))); foreach ($arrContextInfo as $objOneContextInfo) { $objOneContextInfo->HasSuggestions = 1; $objOneContextInfo->Modified = QDateTime::Now(); try { $objOneContextInfo->Save(); } catch (Exception $objEx) { NarroLogger::LogWarn($objEx->getMessage()); } } }
public function Save($blnForceInsert = false, $blnForceUpdate = false) { $this->intTextWordCount = NarroString::WordCount($this->strTextValue); $this->intTextCharCount = strlen($this->strTextValue); $this->strTextValueMd5 = md5($this->strTextValue); if (!$this->__blnRestored || $blnForceInsert) { $this->dttCreated = QDateTime::Now(); } else { $this->dttModified = QDateTime::Now(); } parent::Save($blnForceInsert, $blnForceUpdate); }