PHP midgard object method list_attachments
List object's attachments.
array list_attachments(void);
This method takes no argument:
Lists all object's attachments.
If you need to retrieve only defined attachments, you should use find_atachments method which uses constraints.
Returns array with midgard_attachment objects, or empty array if there are no attachments for object.
Example
<?php
try {
$person = new midgard_style($guid);
} catch (Exception $e) {
echo $e->getMessage();
}
$atts = $style->list_attachments();
if(!empty($atts)) {
foreach($atts as $obj) {
echo $obj->name . ":" . $obj->mimetype ;
}
} else {
echo "No attachments";
}
?>
