示例#1
0
 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));
         }
     }
 }
示例#2
0
 /**
  * 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;
 }