<commit_before><?php

class LogicEntry
{
    public static function getDropDown($type, $name = "")
    {
            return [$name => array_merge(CHtml::listData(ManageRegistration::model()->findAll('type='. $type . " AND `default`=". ManageRegistration::DEFAULT_ADDED ." ORDER BY updated_at DESC"), 'name', 'name', 'group'), ['other' => 'other'])];
    }

    public static function getDropDownDepend()
    {
        $getDependFirst = ManageRegistration::model()->find('type='. ManageRegistration::TYPE_TEACHER_TYPE . " ORDER BY updated_at DESC");
        $data = CHtml::listData(ManageRegistration::model()->findAll('depend='. $getDependFirst->id . " ORDER BY updated_at DESC"), 'name', 'name');
        if(!empty($data)) {
            return $data;
        }

        return ['other' => 'other'];
    }

    public static function getRequired($type)
    {
        return (HSetting::model()->find("name='required_manage' AND value='" . ManageRegistration::$type[$type] .  "'")->value_text == 1)?"*":"";
    }

    /* GROUP */
        public static function getStatusTypeManage($type)
        {
            return (!HSetting::model()->find("name='type_manage' AND value='" . ManageRegistration::$type[$type] .  "'")->value_text == 1)?false:true;
        }<commit_msg>TC-6 - fix other check in admin and display in second step reg<commit_after><?php

class LogicEntry
{
    public static function getDropDown($type, $name = "")
    {
//        return [$name => array_merge(CHtml::listData(ManageRegistration::model()->findAll('type='. $type . " AND `default`=". ManageRegistration::DEFAULT_ADDED ." ORDER BY updated_at DESC"), 'name', 'name', 'group'), ['other' => 'other'])];
        if(empty($name)) {
            return array_merge(CHtml::listData(ManageRegistration::model()->findAll('type='. $type . " ORDER BY updated_at DESC"), 'name', 'name', 'group'), ['other' => 'other']);
        } else {
            return [$name => array_merge(CHtml::listData(ManageRegistration::model()->findAll('type='. $type . self::getQueryTypeManage($type) . " ORDER BY updated_at DESC"), 'name', 'name', 'group'), (self::getStatusTypeManage($type))?['other' => 'other']:[])];
        }
    }

    public static function getDropDownDepend()
    {
        $getDependFirst = ManageRegistration::model()->find('type='. ManageRegistration::TYPE_TEACHER_TYPE . " ORDER BY updated_at DESC");
        $data = CHtml::listData(ManageRegistration::model()->findAll('depend='. $getDependFirst->id . " ORDER BY updated_at DESC"), 'name', 'name');
        if(!empty($data)) {
            return $data;
        }

        return ['other' => 'other'];
    }

    public static function getRequired($type)
    {
        return (HSetting::model()->find("name='required_manage' AND value='" . ManageRegistration::$type[$type] .  "'")->value_text == 1)?"*":"";
    }

    /* GROUP */
        public static function getStatusTypeManage($type)
        {
            return (!HSetting::model()->find("name='type_manage' AND value='" . ManageRegistration::$type[$type] .  "'")->value_text == 1)?false:true;
        }
{'fraction_non_alphanumeric': 0.19058441558441558, 'fraction_numerical': 0.0016233766233766235, 'mean_word_length': 3.5848214285714284, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 30, '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': '7209780', 'n_tokens_mistral': 935, 'n_tokens_neox': 903, 'n_words': 185}