public function _addAttribute($pa_values, $pm_element_code_or_id, $po_trans = null, $pa_info = null) { if (!($t_element = $this->_getElementInstance($pm_element_code_or_id))) { return false; } if ($t_element->get('parent_id') > 0) { return false; } $t_attr = new ca_attributes(); $t_attr->purify($this->purify()); if ($po_trans) { $t_attr->setTransaction($po_trans); } $vn_attribute_id = $t_attr->addAttribute($this->tableNum(), $this->getPrimaryKey(), $t_element->getPrimaryKey(), $pa_values, $pa_info['options']); if ($t_attr->numErrors()) { foreach ($t_attr->errors as $o_error) { $this->postError($o_error->getErrorNumber(), $o_error->getErrorDescription(), $o_error->getErrorContext(), $pa_info['error_source']); } return false; } return $vn_attribute_id; }