Collection¶
Package: Record
- class Collection¶
extends Omeka_Record_AbstractRecord
implements Zend_Acl_Resource_Interface
A collection and its metadata.
- property Collection::$public¶
bool
Whether or not the collection is publicly accessible.
- property Collection::$featured¶
bool
Whether or not the collection is featured.
- property Collection::$added¶
string
Date the collection was added.
- property Collection::$modified¶
string
Date the collection was last modified.
- property Collection::$owner_id¶
int
ID for the User that created this collection.
protected
Related records.
- Collection::_initializeMixins()¶
Initialize the mixins.
- Collection::getProperty($property)¶
Get a property about this collection.
Valid properties for a Collection include: * (int) public * (int) featured * (string) added * (string) modified * (int) owner_id * (int) total_items
Parameters:
- $property (string) – The property to get, always lowercase.
Returns: mixed The value of the property
- Collection::totalItems()¶
Get the total number of items in this collection.
Returns: int
- Collection::setAddedBy(User $user)¶
Set the user who added the collection.
Note that this is not to be confused with the collection’s “contributors”.
Parameters:
- $user (User) –
- Collection::getResourceId()¶
Required by Zend_Acl_Resource_Interface.
Identifies Collection records as relating to the Collections ACL resource.
Returns: string
- Collection::hasContributor()¶
Return whether the collection has at least 1 contributor element text.
Returns: bool
- Collection::filterPostData($post)¶
Filter the POST data from the form.
Converts public/featured flags to booleans.
Parameters:
- $post (array) –
Returns: array
- Collection::_delete()¶
All of the custom code for deleting an collection.
Delete the element texts for this record.
Returns: void
- Collection::_dissociateItems()¶
Set items attached to this collection back to “no collection.”
- Collection::beforeSave($args)¶
Before-save hook.
Fire the before-save element texts code.
Parameters:
- $args –
- Collection::afterSave()¶
After-save hook.
Handle public/private status for search.
- Collection::getFile()¶
Get a representative file for this Collection.
Returns: File|null