OKyJIucT
4/17/2016 - 3:24 PM

beforeSave

beforeSave

public function beforeSave($insert)
{
    if (parent::beforeSave($insert)) {
        $this->user_id = Y::userId();
        $this->slug = Y::slug($this->title);

        return true;
    } else {
        return false;
    }
}