item_metadata = new \Tainacan\Entities\Item_Metadata_Entity($item, $metadatum); if (!empty($value)) $this->item_metadata->set_value($value); if ($this->item_metadata->validate()) { $this->item_metadata = $Tainacan_Item_Metadata->insert($this->item_metadata); } return $this->item_metadata; // If not validated, get_error() method should return the errors. Its up to the tests to use it or not } } ?>