Conversation:
Notices
-
@maiyannah You mean getting the mimeType?
-
@maiyannah $file = File::getByID($id); // works for all dataobjects with numeric 'id' field.
-
@maiyannah You can perhaps have a look at lib/attachmentlistitem.php if not just to see how horribly attachment displays are done in !GNUsocial.
-
@maiyannah I think there is ->attachments() :P
-
@maiyannah If you get an array returned then it's a _copy_ of the original array anyway. Only if it's sent by reference (&$var) do you get something you can manipulate the original of. Or if it's an object (arrays are not objects).
-
@maiyannah Btw, 'php scripts/console.php' lets you try stuff out in a PHP console. Like:
$ php scripts/console.php
GNU social interactive PHP console... type ctrl+D or enter 'exit' to exit.
> $n = Notice::getByID(405641);
> $files = $n->attachments();
> var_dump($files);
[bunchofcrap]
-
@maiyannah Yes, but protected only means you can't access it directly as an object property from an external scope. It's perfectly legal for the parent object to return a copy or a reference.