$object->getattachment

(unknown)

$object->getattachment -- Get a record attachment

Description

object $object->getattachment (int id)

Minimum version: Midgard 1.4 (Bifrost)

Retrieves information about a record attachment by its id.

Returns an object describing the record attachment if successful. Returns FALSE on failure.


<?php
  $person = mgd_get_person(123); // person with id 123 must exist.
  $attid  = 13 ;                 // and have an attachment with id 13.
  if($attachment = $person->getattachment($attid)) {
    echo $attachment->name, $attachment->title ;
  } else {
    echo "Could not get attachment.<br>\n";
    echo "Reason: " .mgd_errstr();
  }
?>

Method available for: article, element, event, event_member, group, host, member, page, pageelement, pagelink, person, preference, sitegroup, snippet, snippetdir, style and topic objects.