public function delete($model) {
        if ($model) {
            if (!is_array($model)) {
                $model = array($model);
            }
            return parent::delete($model);
        }
        else {
            return parent::delete();
        }
        return $this;
    }