The correct way to set a default search value in CakePHP
===

I have a CakePHP Application with many many screens using data from a specific model. Most of the time, I need a specific field to be checked against (like the "user_active=>1" example in the cookbook), however I'd still like to be able to specify that field as a condition and override the default. My code works, but is this the best way to do this?

Also, the $queryData field is mixed — what are the possibilities other than array? just NULL?

    
    <?php public function beforeFind($queryData) {
		if(is_array($queryData)) {
			//query data was an array
			if(!is_array($queryData['conditions'])) {
				$queryData['conditions'] = array('Course.semester_id'=>SEMESTER_ID);
			} else if (!isset($queryData['conditions']['Course.semester_id'])) {
				$queryData['conditions']['Course.semester_id'] = SEMESTER_ID;
			}
		}
	} ?>