Help with Call to undefined method stdClass::save() message

So, I'm getting this problem:

Call to undefined method stdClass::save()in /Users/corey/Sites/RTS/protected/controllers/SampleController.php on line 471



$criteria=new CDbCriteria;


							$criteria->condition='"sampleId"=:sampleId AND "sampleMeasurementTypeId"=:sampleMeasurementTypeId AND "sourceLabId"=:sourceLabId';


							$criteria->params=array(


									':sampleId'=>$postSample['id'],


									':sampleMeasurementTypeId'=>2,


									':sourceLabId'=>3,


									);


	 						$srm=sampleRequiredMeasurement::model()->find($criteria); 


	 						$srm->attributes['sampleId'] = $postSample['id'];


							$srm->attributes['sampleMeasurementTypeId'] = 2;


							$srm->attributes['sourceLabId'] = 3;


	 						$srm->save();


	 						unset($srm);


sampleMeasurementTypeId has 4 columns, id, sampleId, sampleMeasurementTypeId, sourceLabId.

Id is a serial column and the other three are integers. If I do not use the criteria and just do

$srm=sampleRequiredMeasurement::model()->find();

I get a table row just fine. If I do

$srm=sampleRequiredMeasurement::model()->find($criteria); 

and do a var_dump on it immediately afterwards, it is NULL.

What am I doing wrong?

What is line 471?

$srm->save();

However, I suspect this is a product of me programming way past my bed time. The solution is pretty obivous, just the error message was wierd. I forgot to do a check against the find to see if it returned results and create a new object if find found nothing.

I am now accepting insults to my intelligence :)