lrzins Posted March 1, 2013 Share Posted March 1, 2013 Hi Larry, to determine if any records are returned using find() and findAll(), I see that when nothing is returned using find(), that a NULL is returned. When nothing is found using findAll that an empty array is returned. Is this the best way to determine if records are returned?: $var=SomeModelClass::model()->find($condition, $params); if ($var !== null) // Check if a single record is returned. $var=SomeModelClass::model()->findAll($condition, $params); if (!empty($var)) // Check for returned records Larry Z. Link to comment Share on other sites More sharing options...
Larry Posted March 1, 2013 Share Posted March 1, 2013 Yep, that's great. Link to comment Share on other sites More sharing options...
Recommended Posts