При вызове метода save() у модели формируется вот такой запрос INSERT INTO `space` (`id`) VALUES (NULL)
Сама модель
Код: Выделить всё
class Space extends ActiveRecord {
public $title;
public $description;
public $key;
public function rules()
{
return [
[['title', 'description','key'], 'required'],
];
}
public static function tableName()
{
return 'space';
}
public function add($attrs=false)
{
if(is_array($attrs)) {
$this->setAttributes($attrs);
}
if($this->save()) {
return true;
}
return false;
}
Код: Выделить всё
public $title;
public $description;
public $key;
В чем может быть причина, подскажите пожалуйста.