Always getting pointer value, if the pointer object not exist or pointer is undefined.
codetycon opened this issue · 1 comments
codetycon commented
I have an post table, in this table I have an pointer column offer. This pointer is optional for the post. This pointer may have an 'objectId' of offer or may have an null or may have an wrong objectId of offer.
When I using this code:
$offer = $post->get('offer');
Returning a offer detail if exist, If not exist of have an invalid pointer value then it returning a blank value.
What I want is: I want to identify all the wrong pointer value, is this possible to know if the pointer value is wrong (Offer not exist)?
Please let me know the solution
dplewis commented
You can fetch a pointer to know it exists.
$offer->fetch()