| Midgard2 Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <midgard/midgard.h> MgdObject * midgard_object_create_attachment (MgdObject *self, const gchar *name, const gchar *title, const gchar *mimetype); MgdObject ** midgard_object_list_attachments (MgdObject *self); MgdObject ** midgard_object_find_attachments (MgdObject *self, guint n_params, const GParameter *parameters); gboolean midgard_object_has_attachments (MgdObject *self); gboolean midgard_object_delete_attachments (MgdObject *self, guint n_params, const GParameter *parameters); gboolean midgard_object_purge_attachments (MgdObject *self, gboolean delete_blob, guint n_params, const GParameter *parameters);
MgdObject * midgard_object_create_attachment (MgdObject *self, const gchar *name, const gchar *title, const gchar *mimetype);
Creates object's attachment using given properties. Any property may be explicitly set to NULL.
MgdObject ** midgard_object_list_attachments (MgdObject *self);
Returned objects are midgard_attachment class. Attachments objects are fetched from database unconditionally. That is, only those which parent guid property matches object's guid.
Returned array should be freed when no longer needed.
|
a MgdObject self instance |
Returns : |
Newly allocated and NULL terminated array of midgard_attachment objects. |
MgdObject ** midgard_object_find_attachments (MgdObject *self, guint n_params, const GParameter *parameters);
Find object's attachment(s) with matching given properties.
parameters argument is optional. All object's attachments are
returned ( if exist ) if parameters is explicitly set to NULL.
gboolean midgard_object_delete_attachments (MgdObject *self, guint n_params, const GParameter *parameters);
Delete object's attachments(s) which match given properties' values.
Properties list in parameters is optional. All object's attachments are
deleted ( if exist ) if parameters is explicitly set to NULL.
gboolean midgard_object_purge_attachments (MgdObject *self, gboolean delete_blob, guint n_params, const GParameter *parameters);
Purge object's attachments(s) which match given properties' values.
Properties list in parameters is optional. All object's attachments are
purged ( if exist ) if parameters is explicitly set to NULL.
delete_blob should be set to TRUE if midgard_attachment holds a reference
to blob located on filesystem ( it should be set to TRUE by default ).
However, if midgard_attachment is created for blobs sharing and file should not
be deleted, delete_blob should be set to FALSE.
There's no way to determine if midgard_attachment is sharing blob, so aplication itelf is responsible to create such own logic.