Table_Item¶
- class Table_Item¶
Package: Db\Table
- filterByRange(Omeka_Db_Select $select, string $range)¶
Can specify a range of valid Item IDs or an individual ID
Parameters: - $select (Omeka_Db_Select) –
- $range (string) – Example: 1-4, 75, 89
Returns: void
- filterBySearch($select, $params)¶
Run the search filter on the SELECT statement
Parameters: - $select (unknown) –
- $params (unknown) –
Returns: void
- _simpleSearch(Zend_Db_Select $select, $terms)¶
Build the simple search.
The search query consists of a derived table that is INNER JOINed to themain SQL query. That derived table is a union of two SELECT queries. Thefirst query searches the FULLTEXT index on the items_elements table, andthe second query searches the tags table for every word in the searchterms and assigns each found result a rank of ‘1’. That should maketagged items show up higher on the found results list for a given search.
Parameters: - $select (Zend_Db_Select) –
- $terms (unknown) –
- _advancedSearch(Zend_Db_Select $select, $terms)¶
Build the advanced search.
Parameters: - $select (Zend_Db_Select) –
- $terms (unknown) –
- filterByPublic($select, $isPublic)¶
Apply a filter to the items based on whether or not they should be public
Parameters: - $select (unknown) –
- $isPublic (unknown) –
Returns: void
- filterByFeatured($select, $isFeatured)¶
Parameters: - $select (unknown) –
- $isFeatured (unknown) –
- filterByCollection($select, $collection)¶
Filter the SELECT statement based on an item’s collection
Parameters: - $select (unknown) –
- $collection (unknown) –
Returns: void
- filterByItemType($select, $type)¶
Filter the SELECT statement based on the item Type
Parameters: - $select (unknown) –
- $type (unknown) –
Returns: void
- filterByTags($select, $tags)¶
Query must look like the following in order to correctly retrieve items that have all the tags provided (in this example, all items that are tagged both ‘foo’ and ‘bar’):
SELECT i.idFROM omeka_items iWHERE(i.id IN(SELECT tg.record_id as idFROM omeka_records_tags tgINNER JOIN omeka_tags t ON t.id = tg.tag_idWHERE t.name = ‘foo’ AND tg.record_type = ‘Item’)AND i.id IN(SELECT tg.record_id as idFROM omeka_records_tags tgINNER JOIN omeka_tags t ON t.id = tg.tag_idWHERE t.name = ‘bar’ AND tg.record_type = ‘Item’))...
Parameters: - $select (unknown) –
- $tags (unknown) –
Returns: void
- filterByUser($select, integer $userId, $isUser = 1)¶
Filter the SELECT based on the user who owns the item
Parameters: - $select (unknown) –
- $userId (integer) – ID of the User to filter by
- $isUser (unknown) –
Returns: void
- filterByExcludedTags($select, $tags)¶
Filter SELECT statement based on items that are not tagged with a specific set of tags
Parameters: - $select (unknown) –
- $tags (unknown) –
Returns: void
- filterByHasDerivativeImage($select, boolean $hasDerivativeImage = 1)¶
Filter SELECT statement based on whether items have a derivative image file.
Parameters: - $select (unknown) –
- $hasDerivativeImage (boolean) – Whether items should have a derivative image file.
Returns: void
- applySearchFilters($select, $params)¶
Possible options: ‘public’,’user’,’featured’,’collection’,’type’,’tag’, ‘excludeTags’, ‘search’, ‘range’, ‘advanced’, ‘hasImage’,
Parameters: - $select (unknown) –
- $params (unknown) –
Returns: void
- applySorting(Omeka_Db_Select $select, string $sortField, string $sortDir)¶
Enables sorting based on ElementSet,Element field strings.
Parameters: - $select (Omeka_Db_Select) –
- $sortField (string) – Field to sort on
- $sortDir (string) – Sorting direction (ASC or DESC)
- getSelect()¶
This is a kind of simple factory that spits out proper beginnings of SQL statements when retrieving items
Returns: Omeka_Db_Select
- findFirst()¶
Return the first item accessible to the current user.
Returns: Item|null
- findLast()¶
Return the last item accessible to the current user.
Returns: Item|null
- findPrevious($item)¶
Parameters: - $item (unknown) –
- findNext($item)¶
Parameters: - $item (unknown) –
- findNearby($item, $position = next)¶
Parameters: - $item (unknown) –
- $position (unknown) –