$object->listattachments

Name

$object->listattachments -- List the attachments to a record

Synopsis

object $object->listattachments(void);

Description

Minimum version: Midgard 1.4 (Bifrost)

Returns the list of attachments, traversable by calling fetch on the returned object.

Returns an object traversable by calling fetch if successfull. Returns false on failure.

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

Note: This method is only available for objects instantiated by mgd_get_XXX() calls. It is not available for objects instantiated by mgd_list_XXX() calls.

Example

<?php
  $article = mgd_get_article(123); # article with id 123 must exist.
  $list    = $article->listattachments();
  while($list->fetch()) {
    echo "name: " . $list->name . "<br>\n";
  }
?>