How to check if model()->findAll() is returning data?

So I’ve got a model, and in the view where I output the data, I want to check if there is anything coming from the model.

Is this a reasonable way to check for data? It seems like the return from model() is just a simple object… I suppose I could try is_array() or is_object() to tell if data is being returned?


<div class="theme-gallery">

	<? if (count($model)) { ?>


		<? foreach ($model as $theme) { ?>

		<li><div><?php echo $theme->themeName;?></div></li>

		<? } ?>


	<? } else { ?>

	Currently no themes. Add One.

	<? } ?>



	public function actionMyThemes()


		$model = Theme::model()->user()->findAll();


		$this->render('my-themes', array('model'=>$model));


findAll() returns an array of objects, so count() is ok