Table_File¶
- class Table_File¶
Package: Db\Table
- property _target¶
- getSelect()¶
All files should only be retrieved if they join properly on the items table.
Returns: Omeka_Db_Select
- getRandomFileWithImage(integer $itemId)¶
Retrieve a random file with an image associated with an item.
Parameters: - $itemId (integer) –
Returns: File
- findByItem(integer $itemId, array $fileIds = Array, string $sort = order)¶
Retrieve files associated with an item.
Parameters: - $itemId (integer) –
- $fileIds (array) – Optional If given, this will only retrieve files with these specific IDs.
- $sort (string) – The manner by which to order the files. For example: ‘id’: file id, ‘filename’ = alphabetical by filename. The default is ‘order’, following the user’s specified order.
Returns: array
- findWithImages(integer $itemId, integer|null $index, string $sort = order)¶
Retrieve files for an item that has derivative images.
Parameters: - $itemId (integer) – The ID of the item to get images for.
- $index (integer|null) – Optional If given, this specifies the file to retrieve for an item, based upon the ordering of its files.
- $sort (string) – The manner by which to order the files. For example: ‘id’: file id, ‘filename’: alphabetical by filename. The default is ‘order’, following the user’s specified order.
Returns: File|array
- _orderFilesBy($select, string $sort)¶
Orders select results for files.
Parameters: - $select (unknown) –
- $sort (string) – The manner in which to order the files by. For example: ‘id’ = file id ‘filename’ = alphabetical by filename
Returns: void