public function getAttribute() { if (!$this->attribute) { $att = new Dase_DBO_Attribute($this->db); $att->load($this->attribute_id); $this->attribute = $att; } return $this->attribute; }
public function getAttributes() { $attributes = array(); if ('default' == $this->ascii_id) { $c = $this->getCollection(); foreach ($c->getAttributes() as $att) { $att = clone $att; $att->getFormValues(); $attributes[strtolower($att->attribute_name)] = $att; } } else { $att_it = new Dase_DBO_AttributeItemType($this->db); $att_it->item_type_id = $this->id; foreach ($att_it->find() as $ait) { $att = new Dase_DBO_Attribute($this->db); if ($att->load($ait->attribute_id)) { $att->getFormValues(); // for sorting // are attribute names unique??? $attributes[strtolower($att->attribute_name)] = $att; } } } ksort($attributes); $this->attributes = $attributes; return $attributes; }
public function getMetadataJson($app_root) { //clean up to use standard names $metadata = array(); foreach ($this->_getMetadata() as $meta) { $set = array(); $set['value_id'] = $meta['id']; $set['url'] = $app_root . $meta['edit-id']; $set['collection_id'] = $meta['collection_id']; $set['att_ascii_id'] = $meta['ascii_id']; $set['attribute_name'] = $meta['attribute_name']; $set['html_input_type'] = $meta['html_input_type']; $set['value_text'] = $meta['value_text']; $set['metadata_link_url'] = $meta['url']; $set['modifier'] = $meta['modifier']; $set['modifier_type'] = $meta['modifier_type']; if (in_array($meta['html_input_type'], array('radio', 'checkbox', 'select', 'text_with_menu'))) { $att = new Dase_DBO_Attribute($this->db); $att->load($meta['att_id']); $set['values'] = $att->getFormValues(); } $metadata[] = $set; } return Dase_Json::get($metadata); }
function getAdminEquiv($mapped_id) { if ($this->mapped_admin_att_id) { $mapped_id = $this->mapped_admin_att_id; } $aa = new Dase_DBO_Attribute($this->db); if ($aa->load($mapped_id)) { return $aa->ascii_id; } else { return 'none'; } }