[Solar-talk] Solar_Sql_Model - when a related record doesn't exist

Rodrigo Moraes rodrigo.moraes at gmail.com
Mon May 7 20:39:34 PDT 2007


Hi,
Which is the best approach to check if a related model exists? If it
tries to load a related record set using has-one, it will call
Solar_Sql_Model::_loadRecord($data). If there's not such record, $data
will be false and then, in the first foreach, a warning will appear.

The question is: shouldn't Solar_Sql_Model set the property to false
or null when the related record doesn't exist, thus avoiding the
warning and allowing us to check if the data exists?

rodrigo


More information about the solar-talk mailing list