<commit_before><?php

namespace common\models;

/**
 * School (university, academy, institute)
 *
 * @property-read string $country
 * @property-read string $countryLabel
 * @property-read string $regionLabel
 * @property-read string $stateLabel
 * @property-read string $schoolName
 */
class School extends \common\ext\MongoDb\Document
{

    // Scenarios
    const SC_ASSIGN_TO_TEAM = 'assignToTeam';

    /**
     * Full university name in ukranian
     * @var string
     */
    public $fullNameUk;

    /**
     * Full university name in english
     * @var string
     */
    public $fullNameEn;

    /**
     * Short university name in ukrainian
     * @var string
     */
    public $shortNameUk;

    /**
     * Short university name in english
     * @var string
     */
    public $shortNameEn;

    /**
     * State
     * @var string
     */
    public $state;

    /**
     * Region
     * @var string
     */
    public $region;

    /**
     * Returns school name in appropriate language
     *
     * @return string
     */
    public function getSchoolName()
    {
        switch ($this->useLanguage) {
            default:
            case 'uk':
                return $this->fullNameUk;
                break;
            case 'en':
                return (!empty($this->fullNameEn)) ? $this->fullNameEn : $this->fullNameUk;
                break;
        }
    }

    /**
     * Returns country
     *
     * @return string
     */
    public function getCountry()
    {
        return 'ukraine';
    }

    /**
     * Returns country label
     *
     * @return string
     */
    public function getCountryLabel()
    {
        return \yii::t('app', 'Ukraine');
    }

    /**
     * Returns region label
     *
     * @return string
     */
    public function getRegionLabel()
    {
        return Geo\Region::model()->getAttributeLabel($this->region);
    }

    /**
     * Returns state label
     *
     * @return string
     */
    public function getStateLabel()
    {
        return Geo\State::model()->getAttributeLabel($this->state);
    }

    /**
     * Returns the attribute labels.
     *
     * Note, in order to inherit labels defined in the parent class, a child class needs to
     * merge the parent labels with child labels using functions like array_merge().
     *
     * @return array attribute labels (name => label)
     */
    public function attributeLabels()
    {
        return array_merge(parent::attributeLabels(), array(
            'fullNameUk'    => \yii::t('app', 'Full university name in ukrainian'),
            'fullNameEn'    => \yii::t('app', 'Full university name in english'),
            'shortNameUk'   => \yii::t('app', 'Short university name in ukrainian'),
            'shortNameEn'   => \yii::t('app', 'Short university name in english'),
            'state'         => \yii::t('app', 'State'),
            'region'        => \yii::t('app', 'Region'),

        ));
    }

    /**
     * Define attribute rules
     *<commit_msg>#183 fix bug<commit_after><?php

namespace common\models;

/**
 * School (university, academy, institute)
 *
 * @property-read string $country
 * @property-read string $countryLabel
 * @property-read string $regionLabel
 * @property-read string $stateLabel
 * @property-read string $schoolName
 */
class School extends \common\ext\MongoDb\Document
{

    // Scenarios
    const SC_ASSIGN_TO_TEAM = 'assignToTeam';

    /**
     * Full university name in ukranian
     * @var string
     */
    public $fullNameUk;

    /**
     * Full university name in english
     * @var string
     */
    public $fullNameEn;

    /**
     * Short university name in ukrainian
     * @var string
     */
    public $shortNameUk;

    /**
     * Short university name in english
     * @var string
     */
    public $shortNameEn;

    /**
     * State
     * @var string
     */
    public $state;

    /**
     * Region
     * @var string
     */
    public $region;

    /**
     * Returns school name in appropriate language
     *
     * @return string
     */
    public function getSchoolName()
    {
        switch ($this->useLanguage) {
            default:
            case 'uk':
                return $this->fullNameUk;
                break;
            case 'en':
                return (!empty($this->fullNameEn)) ? $this->fullNameEn : $this->fullNameUk;
                break;
        }
    }

    /**
     * Returns country
     *
     * @return string
     */
    public function getCountry()
    {
        return 'ukraine';
    }

    /**
     * Returns country label
     *
     * @return string
     */
    public function getCountryLabel()
    {
        return \yii::t('app', 'Ukraine');
    }

    /**
     * Returns region label
     *
     * @return string
     */
    public function getRegionLabel()
    {
        return Geo\Region::model()->getAttributeLabel($this->region, 'name');
    }

    /**
     * Returns state label
     *
     * @return string
     */
    public function getStateLabel()
    {
        return Geo\State::model()->getAttributeLabel($this->state, 'name');
    }

    /**
     * Returns the attribute labels.
     *
     * Note, in order to inherit labels defined in the parent class, a child class needs to
     * merge the parent labels with child labels using functions like array_merge().
     *
     * @return array attribute labels (name => label)
     */
    public function attributeLabels()
    {
        return array_merge(parent::attributeLabels(), array(
            'fullNameUk'    => \yii::t('app', 'Full university name in ukrainian'),
            'fullNameEn'    => \yii::t('app', 'Full university name in english'),
            'shortNameUk'   => \yii::t('app', 'Short university name in ukrainian'),
            'shortNameEn'   => \yii::t('app', 'Short university name in english'),
            'state'         => \yii::t('app', 'State'),
            'region'        => \yii::t('app', 'Region'),

        ));
    }

    /**
     * Define attribute rules
     *
{'fraction_non_alphanumeric': 0.1281795511221945, 'fraction_numerical': 0.0004987531172069825, 'mean_word_length': 1.8498342018000948, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '2849042', 'n_tokens_mistral': 1764, 'n_tokens_neox': 1689, 'n_words': 448}