hello i made a model
class ApplicationVersion extends CModel {
public $key;
public $version;
public $description;
public function __construct($key = null, $version = null, $desc = null) {
$this->key = $key;
$this->version = $version;
$this->description = $desc;
}
public function attributeNames() {
return array('key', 'version', 'description');
}
public function getPrimaryKey() {
return $this->key;
}
}
when i try to set it’s attributes with
$av = new ApplicationVersion;
$av->attributes = array('key' => 1, 'version' => '2', 'description' => 3);
it doesn’t work
$av->version, key and description are still null
the problem is that i can’t do this
if (isset($_GET['ApplicationVersion']))
$model->attributes = $_GET['ApplicationVersion']
if i do it manually with
$model->version = $_GET['ApplicationVersion']['version'];
$model->description = $_GET['ApplicationVersion']['description'];
it’s ok
can anyone help me solve this problem?
thanks