<commit_before><?php

namespace backend\controllers;

use Yii;
use common\models\Company;
use common\models\CompanySearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

/**
 * CompanyController implements the CRUD actions for Company model.
 */
class CompanyController extends Controller {

    public function behaviors() {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }
    
    public function actionGeneral($id = 1) {
        $model = $this->findModel($id);

         if ($model->load(Yii::$app->request->post())) {
            $model->last_modified_by = Yii::$app->user->identity->username;
            $model->last_modified_date = date('Y-m-d h:m:s');
            $model->save();
            return $this->redirect(['general', 'id' => $model->id]);
        } else {
            return $this->render('general', [
                        'model' => $model,
            ]);
        }
    }

    public function actionAboutUs($id = 1) {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post())) {
            $model->last_modified_by = Yii::$app->user->identity->username;
            $model->last_modified_date = date('Y-m-d h:m:s');
            $model->save();
            Yii::$app->session->setFlash('success', 'Update Success.');
            return $this->refresh();
        } else {
            return $this->render('about-us', [
                        'model' => $model,
            ]);
        }
    }

    public function actionPrivacyPolicy($id = 1) {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post())) {
            $model->last_modified_by = Yii::$app->user->identity->username;
            $model->last_modified_date = date('Y-m-d h:m:s');
            $model->save();<commit_msg>Tambahan Flash pada Company Controller dan fungsi findModel<commit_after><?php

namespace backend\controllers;

use Yii;
use common\models\Company;
use common\models\CompanySearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

/**
 * CompanyController implements the CRUD actions for Company model.
 */
class CompanyController extends Controller {

    public function behaviors() {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }
    
    public function actionGeneral($id = 1) {
        $model = $this->findModel($id);

         if ($model->load(Yii::$app->request->post())) {
            $model->last_modified_by = Yii::$app->user->identity->username;
            $model->last_modified_date = date('Y-m-d h:m:s');
            $model->save();
            Yii::$app->session->setFlash('success', 'Update Success.');
            return $this->refresh();
        } else {
            return $this->render('general', [
                        'model' => $model,
            ]);
        }
    }

    public function actionAboutUs($id = 1) {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post())) {
            $model->last_modified_by = Yii::$app->user->identity->username;
            $model->last_modified_date = date('Y-m-d h:m:s');
            $model->save();
            Yii::$app->session->setFlash('success', 'Update Success.');
            return $this->refresh();
        } else {
            return $this->render('about-us', [
                        'model' => $model,
            ]);
        }
    }

    public function actionPrivacyPolicy($id = 1) {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post())) {
            $model->last_modified_by = Yii::$app->user->identity->username;
            $model->last_modified_date = date('Y-m-d h:m:s');
            $model->save();
{'fraction_non_alphanumeric': 0.17076771653543307, 'fraction_numerical': 0.0014763779527559055, 'mean_word_length': 1.9499274310595065, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5551269', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1168, 'n_words': 203}