public function beforeSave() { if (!$this->gas_volume_id) { $this->gas_volume_id = null; } return parent::beforeSave(); }