<commit_before><?php

namespace backend\modules\api\controllers;

use yii\rest\ActiveController;
use backend\models\Establishment;

use Yii;

class EstablishmentController extends ActiveController
{
    public $modelClass = 'backend\models\Establishment';  
    
    
    public function actions(){
        $actions = parent::actions();
        unset($actions['create']);
        return $actions;
    }

    protected function verbs(){
        return [
            'create' => ['POST'],
            'update' => ['PUT', 'PATCH','POST'],
            'delete' => ['DELETE'],
            'view' => ['GET'],
            'index'=>['GET'],
        ];
    }
    
    public function actionCreate(){
        $model = new Establishment();
        $model->load(Yii::$app->request->post(),'');
        $model->save();
    }
}

<commit_msg>Se adiciona validacion de numero de matricula<commit_after><?php

namespace backend\modules\api\controllers;

use yii\rest\ActiveController;
use backend\models\Establishment;

use Yii;

class EstablishmentController extends ActiveController
{
    public $modelClass = 'backend\models\Establishment';  
    
    
    public function actions(){
        $actions = parent::actions();
        unset($actions['create']);
        return $actions;
    }

    protected function verbs(){
        return [
            'create' => ['POST'],
            'update' => ['PUT', 'PATCH','POST'],
            'delete' => ['DELETE'],
            'view' => ['GET'],
            'index'=>['GET'],
        ];
    }
    
    public function actionCreate(){
        $model = new Establishment();
        $model->load(Yii::$app->request->post(),'');
        $model->save();
        return $model;
    }
}


{'fraction_non_alphanumeric': 0.1614979520187244, 'fraction_numerical': 0.0, 'mean_word_length': 2.3333333333333335, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '934775', 'n_tokens_mistral': 482, 'n_tokens_neox': 481, 'n_words': 100}