I am storing the first image, item id from an item that is part of an exhibit in a separate table in db.
I would like to find out if an item id exist in an exhibit object. Is there a function I can use to give item id and it will return if an exhibit has this item id or not? if not I will code it.
The reason behind my question to find out when an item belong to an exhibit deleted at any time to store an image from another existing item.
There isn't a function I know of to do that.
If all that you need to know is whether an item is in an exhibit, then you would just check for the item_id in ExhibitPageEntry table. If you need to know _which_ exhibit an item is part of, you would start from that info and work your way back to the Exhibit itself. The page_id will get you the ExhibitPage, and the rest is easy by doing something like this once $exhibitPage holds the ExhibitPage record you need:
$section = $exhibitPage->Section;
$exhibit = $section->Exhibit;
The section and Exhibit records get automatically set when you do this.
I will try the ExhibitPageEntry table.
All what I need to know so far if an image file name of an item is part of an exhibit or not. Since I store the link to the image file name in a created table that store the exhibit id with thumbnail of image file name. Our user wants an image for each exhibit. So I grape that image from an item in its exhibit. but in case this item is deleted I do need to know to remove it's image from the table and add a new image.
The other alternative is to ask the user to load his own image in configuration part of the theme. but then I will store it. That alternative is easy too but I am not sure how much I do need to style it and if change the image size to thumbnail size will destroy the quality of the image !
do you have an idea how I can proceed with the second option but use Omeka func if there any to get a thumbnail of the image instead of regular size?
I am using this function $items = get_items(array('exhibit' => $exhibit));
and I am passing the exhibit object.
The first item in items array is the last item I added to the page. is there a way I can get the first item in the exhibit?