protected function saveDBData() { $values = $this->ui->getValues(array('title', 'name', 'event', 'archived')); $this->tag->title = $values['title']; $this->tag->name = $values['name']; $this->tag->event = $values['event']; $this->tag->archived = $values['archived']; if ($this->id === null) { $now = new SwatDate(); $this->tag->createdate = $now->getDate(); } $flush_cache = $this->tag->isModified() && $this->tag->id !== null; $this->tag->save(); $this->addToSearchQueue(); if (isset($this->app->memcache) && $flush_cache) { $this->app->memcache->flushNs('photos'); } $message = new SwatMessage(sprintf(Pinhole::_('“%s” has been saved.'), $this->tag->title)); $this->app->messages->add($message); }