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';







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

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

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



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


I get a table row just fine. If I do


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

What am I doing wrong?

What is line 471?


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 :)