I have a column of type array. It stores pointers to other objects. So in my loop I have something like this:
foreach ($artworkArr as $a) {
$a->fetch();
$artworkName[] = $a->get('title');
}
Problem here is, fetch immediately throws an exception if the pointer points to an invalid object.
How can I check if the object exists before calling the fetch method?
try/catchto catch these exceptions