<commit_before><?php

namespace core\models;

use Yii;
use core\components\DefaultQuery;
use \core\components\ActiveRecord;

/**
 * This is the model class for table "AdminMenu".
 *
 * @property integer $id
 * @property integer $AdminMenu_id
 * @property string $name
 * @property string $internal
 * @property string $url
 * @property string $ap
 * @property integer $order
 * @property string $show_mobile
 * @property string $status
 * @property string $update_time
 * @property integer $update_by
 * @property string $create_time
 * @property integer $create_by
 *
 * @property AdminMenu $adminMenu
 * @property AdminMenu[] $adminMenus
 */
class AdminMenu extends ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'AdminMenu';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['AdminMenu_id', 'order', 'update_by', 'create_by'], 'integer'],
            [['name', 'internal', 'order'], 'required'],
            [['ap', 'show_mobile', 'status'], 'string'],
            [['update_time', 'create_time'], 'safe'],
            [['name', 'internal', 'url'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     * @return DefaultQuery
     */
    public static function find()
    {
        return new DefaultQuery(get_called_class());
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getAdminMenu()
    {
        return $this->hasOne(AdminMenu::className(), ['id' => 'AdminMenu_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getAdminMenus()
    {
        return $this->hasMany(AdminMenu::className(), ['AdminMenu_id' => 'id'])->orderby('order ASC');
    }
}
<commit_msg>hiding admin menus when they are inactive<commit_after><?php

namespace core\models;

use Yii;
use core\components\DefaultQuery;
use \core\components\ActiveRecord;

/**
 * This is the model class for table "AdminMenu".
 *
 * @property integer $id
 * @property integer $AdminMenu_id
 * @property string $name
 * @property string $internal
 * @property string $url
 * @property string $ap
 * @property integer $order
 * @property string $show_mobile
 * @property string $status
 * @property string $update_time
 * @property integer $update_by
 * @property string $create_time
 * @property integer $create_by
 *
 * @property AdminMenu $adminMenu
 * @property AdminMenu[] $adminMenus
 */
class AdminMenu extends ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'AdminMenu';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['AdminMenu_id', 'order', 'update_by', 'create_by'], 'integer'],
            [['name', 'internal', 'order'], 'required'],
            [['ap', 'show_mobile', 'status'], 'string'],
            [['update_time', 'create_time'], 'safe'],
            [['name', 'internal', 'url'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     * @return DefaultQuery
     */
    public static function find()
    {
        return new DefaultQuery(get_called_class());
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getAdminMenu()
    {
        return $this->hasOne(AdminMenu::className(), ['id' => 'AdminMenu_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getAdminMenus()
    {
        return $this->hasMany(AdminMenu::className(), ['AdminMenu_id' => 'id'])->andWhere(['status' => self::STATUS_ACTIVE])->orderby('order ASC');
    }
}

{'fraction_non_alphanumeric': 0.15648327343102017, 'fraction_numerical': 0.0016588332872546309, 'mean_word_length': 2.737603305785124, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '727796', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1071, 'n_words': 265}