protected function initMetaData() { $this->metadata = new PinholeMetaData(); $this->metadata->setDatabase($this->app->db); $this->metadata->instance = $this->app->getInstance(); if ($this->id === null) { } else { if (!$this->metadata->load($this->id)) { throw new AdminNotFoundException(sprintf(Pinhole::_('MetaData with id ā%sā not found.'), $this->id)); } } }
/** * Whether or not a name-value pair is valid for this meta tag * * @param string $name the name. * @param string $value the value. * * @return boolean true if the name-value pair is valid for this meta tag * and false if the name-value pair is not valid for this * meta tag. */ private function isValid($name, $value) { $valid = false; $class_name = SwatDBClassMap::get('PinholeMetaData'); $this->meta_data = new $class_name(); $this->meta_data->setDatabase($this->db); // ensure meta data object exists $valid = $this->meta_data->loadByShortname($name, $this->instance); return $valid; }