public function beforeValidate() { parent::beforeValidate(); if (empty($this->ptime)) { $this->ptime = time(); } // if(!empty($this->parent_id)){ // $this->slug = $this->parent->slug.'/'.$this->baseslug; // }else{ // $this->slug = $this->baseslug; // } }