<commit_before><?php

namespace common\models\search;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\UnitReport;

/**
 * SearchUserProfile represents the model behind the search form about `common\models\UserProfile`.
 */
class SearchUnitReport extends UnitReport
{
    public $module_id;
	/**
     * @inheritdoc
     */
    public function rules()
    {
        return [
          //  [['unit_id'], 'integer'],
            [['cap_done_by','student_id','unit_id','module_id'], 'string'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = UnitReport::find()->where(['not',['cap_done_by'=>NULL]]);

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
		$query->joinWith(['unit as u']);
		$query->joinWith(['unit.module as m']);
		$query->joinWith(['user_profile as profile']);
		$query->joinWith(['assessor as assr']);
		$query->joinWith(['assessor.user']);
		//$query->joinWith(['program']);
		$query->andFilterWhere(['user.c_id'=>\Yii::$app->user->identity->c_id,'user.status'=>10]);
		
        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails<commit_msg>remove drafted status inits and modules from reset<commit_after><?php

namespace common\models\search;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\UnitReport;

/**
 * SearchUserProfile represents the model behind the search form about `common\models\UserProfile`.
 */
class SearchUnitReport extends UnitReport
{
    public $module_id;
	/**
     * @inheritdoc
     */
    public function rules()
    {
        return [
          //  [['unit_id'], 'integer'],
            [['cap_done_by','student_id','unit_id','module_id'], 'string'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = UnitReport::find()->where(['not',['cap_done_by'=>NULL]]);

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
		$query->joinWith(['unit as u']);
		$query->joinWith(['unit.module as m']);
		$query->joinWith(['user_profile as profile']);
		$query->joinWith(['assessor as assr']);
		$query->joinWith(['assessor.user']);
		//$query->joinWith(['program']);
		$query->andFilterWhere(['user.c_id'=>\Yii::$app->user->identity->c_id,'user.status'=>10]);
		$query->andFilterWhere(['u.status'=>1]);
		$query->andFilterWhere(['m.status'=>1]);
        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
{'fraction_non_alphanumeric': 0.15951276102088166, 'fraction_numerical': 0.0017401392111368909, 'mean_word_length': 2.8450390189520625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, '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': '1998779', 'n_tokens_mistral': 1013, 'n_tokens_neox': 985, 'n_words': 234}