public function add_links() { parent::add_links(); // check for blog posts this file may be attached to if (!($posts = get_records_array('artefact_attachment', 'attachment', $this->artefact->get('id')))) { return; } foreach ($posts as $p) { $post = artefact_instance_from_id($p->artefact); $this->add_artefact_link($post, 'is_attachment_of'); } }
public function add_links() { parent::add_links(); // add on attachments if (!($attachments = $this->artefact->attachment_id_list())) { return; } foreach ($attachments as $attachment) { $f = artefact_instance_from_id($attachment); $this->add_artefact_link($f, 'has_attachment'); } }