private function initTag() { $tag_class = SwatDBClassMap::get('BlorgTag'); $this->tag = new $tag_class(); $this->tag->setDatabase($this->app->db); if (!$this->tag->load($this->id)) { throw new AdminNotFoundException(sprintf(Blorg::_('Tag with id “%s” not found.'), $this->id)); } }
protected function initTag() { $this->tag = new BlorgTag(); $this->tag->setDatabase($this->app->db); if ($this->id !== null) { if (!$this->tag->load($this->id)) { throw new AdminNotFoundException(sprintf(Blorg::_('Tag with id ‘%s’ not found.'), $this->id)); } $instance_id = $this->tag->getInternalValue('instance'); if ($instance_id !== $this->app->getInstanceId()) { throw new AdminNotFoundException(sprintf(Blorg::_('Tag with id ‘%d’ not found.'), $this->id)); } } }