Esempio n. 1
0
 public function Insert()
 {
     if ($this->DateTime == null) {
         $this->DateTime = date('Y-m-d H:i:s');
     }
     parent::Insert();
 }
Esempio n. 2
0
 public function Update()
 {
     $this->Updated = date('Y-m-d H:i:s');
     $TagTitles = '';
     // for perfomance, we don't need lazy loading in this loop
     $this->PostsTags->LoadList('Tag');
     foreach ($this->PostsTags as $PostsTags) {
         $TagTitles .= $PostsTags->Tag->Title;
     }
     $CommentText = '';
     foreach ($this->Comments as $Comment) {
         $CommentText .= $Comment->Text;
     }
     $this->SearchHelper = $this->User->Name . $this->Text . $TagTitles . $CommentText;
     parent::Update();
 }