php - Omeka: Get all items in Controller -


i'm writing omeka plugin , wants list of public items elements, in controller under plugin.

i've tried get_items() function doesn't exists, looks function available views - not sure how.

another try manually fetch records database, that's not standard way.

so, question is, there predefined function/class or way items in controller?

i'm not sure if there function items along of element texts, if want list of items, inside controller should able make call like:

$items = $this->_helper->db->gettable('item')->findall(); 

the omeka docs warn against getting items @ once because memory intensive. so, alternatively, can loop through items.

$items = $this->_helper->db->gettable('item'); $item = $items->findfirst(); while($item != null){     //     $item = $items->findnext($item); } 

there "public" property on item tells if it's public. in order element texts item, think you'd have make query on elementtext table.

for more information, see omeka read docs page table_item, omeka_db_table , item:

http://omeka.readthedocs.io/en/latest/reference/libraries/omeka/db/table.html http://omeka.readthedocs.io/en/latest/reference/models/table/item.html http://omeka.readthedocs.io/en/latest/reference/models/item.html


Comments

Popular posts from this blog

javascript - Hide toolbar of pdf file opened inside iframe using firefox -

Ansible - ERROR! the field 'hosts' is required but was not set -

Copy range with conditional formatting -