How to get a property without raising Exception when doesn’t exists?
$model->address1
raises exception: [font=monospace]Property "registration.address1" is not defined.[/font]
How to get a property without raising Exception when doesn’t exists?
$model->address1
raises exception: [font=monospace]Property "registration.address1" is not defined.[/font]
To me it sounds like bad application design.
Just like you would do it with any other PHP variable… use isset()
(isset($model->address1)? $model->address1 : 'no adress'
I am using in a situation when the relation might not yet been loaded.