/** * Enable the metadata * * @return bool * @since 1.8 */ public function enable() { $success = _elgg_set_metastring_based_object_enabled_by_id($this->id, 'yes', 'metadata'); if ($success) { _elgg_services()->metadataCache->clear($this->entity_guid); } return $success; }
public function testEnableDisableByID() { $db_prefix = elgg_get_config('dbprefix'); $annotation = $this->createAnnotations(1); $metadata = $this->createMetadata(1); foreach ($this->metastringTypes as $type) { $id = ${$type}[0]; $table = $db_prefix . $this->metastringTables[$type]; $q = "SELECT * FROM {$table} WHERE id = {$id}"; $test = get_data($q); // disable $this->assertEqual($test[0]->enabled, 'yes'); $this->assertTrue(_elgg_set_metastring_based_object_enabled_by_id($id, 'no', $type)); $test = get_data($q); $this->assertEqual($test[0]->enabled, 'no'); // enable $ashe = access_get_show_hidden_status(); access_show_hidden_entities(true); $this->assertTrue(_elgg_set_metastring_based_object_enabled_by_id($id, 'yes', $type)); $test = get_data($q); $this->assertEqual($test[0]->enabled, 'yes'); access_show_hidden_entities($ashe); $this->assertTrue(_elgg_delete_metastring_based_object_by_id($id, $type)); } }
/** * Enable the annotation. * * @return bool * @since 1.8 */ public function enable() { return _elgg_set_metastring_based_object_enabled_by_id($this->id, 'yes', 'annotations'); }
/** * Enable the metadata * * @return bool * @since 1.8 */ public function enable() { $success = _elgg_set_metastring_based_object_enabled_by_id($this->id, 'yes', 'metadata'); if ($success) { _elgg_get_metadata_cache()->markUnknown($this->entity_guid, $this->name); } return $success; }