How to update a record with field as a variable / Help Please!

How to update a record with field as a variable

Hello,

Here is a piece of code that fails :

// load record
    $control = new Control($name);
    // update record
    $control->set($field, $value);
    // save record
    $control->store();

Because 'set' is a protected method of an fActiveRecord.

However, I dont know what alternative to use. In this block, I dont know the field to update, I cannot do, for example, method 'setName' because field may be 'name' but maybe 'duration', etc…

Thanks for your help !

Aurelien