addBehavior( new SoftDelete([ 'field' => 'deleted', 'value' => 1, ]) ); } public function beforeCreate() { $this->create_time = time(); } public function beforeUpdate() { $this->update_time = time(); } public static function positionTypes() { return new Collection([ self::POSITION_TOP => '顶部', self::POSITION_BOTTOM => '底部', ]); } public static function targetTypes() { return new Collection([ self::TARGET_BLANK => '新窗口', self::TARGET_SELF => '原窗口', ]); } }