<commit_before><?php

namespace app\models;

use app\components\ArChangeLoggerBehavior;
use dektrium\user\models\Profile as BaseProfile;
use Yii;
use yii\helpers\ArrayHelper;

class Profile extends BaseProfile
{

    public function behaviors()
    {

        return ArrayHelper::merge(
            parent::behaviors(), [
                [
                    'class'           => ArChangeLoggerBehavior::className(),
                    'primaryKey'      => 'user_id',
                    'logClassName'    => 'felhasználó profil',
                    'logNameProperty' => function () {
                        return $this->user->username;
                    },
                ],

            ]
        );
    }

    public function rules()
    {
        return ArrayHelper::merge(
            parent::rules(),
            [
                [['language','yami_id', 'barcode'], 'string'],
                [['school_class_id'], 'integer'],
                [['barcode'], 'unique'],
                [['eating_time_start', 'eating_time_end'], 'safe'],
            ]

        );
    }

    public function attributeLabels()
    {
        $merged = ArrayHelper::merge(
            parent::attributeLabels(),
                [
                    'yami_id'           => \Yii::t('user', 'Yami azonosító'),
                    'school_class_id'   => \Yii::t('user', 'Osztály'),
                    'eating_time_start' => 'Egyéni étkezési idősáv kezdete',
                    'eating_time_end'   => 'Egyéni étkezési idősáv vége',
                    'barcode'           => 'Kártyaazonosító',
                    'language'           => 'Nyelv',
                ]


        );
        return $merged;
    }

    public function getSchoolClass()
    {
        return $this->hasOne(SchoolClass::className(), ['id' => 'school_class_id']);
    }
}<commit_msg>resolved #120 Yami azonosító egyediség ellenőrzés<commit_after><?php

namespace app\models;

use app\components\ArChangeLoggerBehavior;
use dektrium\user\models\Profile as BaseProfile;
use Yii;
use yii\helpers\ArrayHelper;

class Profile extends BaseProfile
{

    public function behaviors()
    {

        return ArrayHelper::merge(
            parent::behaviors(), [
                [
                    'class'           => ArChangeLoggerBehavior::className(),
                    'primaryKey'      => 'user_id',
                    'logClassName'    => 'felhasználó profil',
                    'logNameProperty' => function () {
                        return $this->user->username;
                    },
                ],

            ]
        );
    }

    public function rules()
    {
        return ArrayHelper::merge(
            parent::rules(),
            [
                [['language', 'yami_id', 'barcode'], 'string'],
                [['school_class_id'], 'integer'],
                [['barcode', 'yami_id'], 'unique'],
                [['eating_time_start', 'eating_time_end'], 'safe'],
            ]

        );
    }

    public function attributeLabels()
    {
        $merged = ArrayHelper::merge(
            parent::attributeLabels(),
            [
                'yami_id'           => \Yii::t('user', 'Yami azonosító'),
                'school_class_id'   => \Yii::t('user', 'Osztály'),
                'eating_time_start' => 'Egyéni étkezési idősáv kezdete',
                'eating_time_end'   => 'Egyéni étkezési idősáv vége',
                'barcode'           => 'Kártyaazonosító',
                'language'          => 'Nyelv',
            ]

        );
        return $merged;
    }

    public function getSchoolClass()
    {
        return $this->hasOne(SchoolClass::className(), ['id' => 'school_class_id']);
    }
}
{'fraction_non_alphanumeric': 0.13214670981661272, 'fraction_numerical': 0.0008090614886731392, 'mean_word_length': 1.5026990553306343, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '2051713', 'n_tokens_mistral': 1089, 'n_tokens_neox': 1032, 'n_words': 179}