addBehavior( new SoftDelete([ 'field' => 'deleted', 'value' => 1, ]) ); } public function beforeCreate() { $this->create_time = time(); } public function beforeUpdate() { $this->update_time = time(); } public static function targetTypes() { return [ self::TARGET_COURSE => '课程', self::TARGET_PAGE => '单页', self::TARGET_LINK => '链接', ]; } }