erLhcoreClassModelDepartament::__get PHP 메소드

__get() 공개 메소드

public __get ( $var )
    public function __get($var)
    {
        switch ($var) {
            case 'is_online':
                $this->is_online = erLhcoreClassChat::isOnline($this->id);
                return $this->is_online;
                break;
            case 'is_online_exclipic':
                $this->is_online_exclipic = erLhcoreClassChat::isOnline($this->id, true);
                return $this->is_online_exclipic;
                break;
            case 'inform_options_array':
                $this->inform_options_array = $this->inform_options != '' ? unserialize($this->inform_options) : array();
                return $this->inform_options_array;
                break;
            case 'can_delete':
                $this->can_delete = erLhcoreClassChat::getCount(array('filter' => array('dep_id' => $this->id))) == 0;
                return $this->can_delete;
                break;
            case 'department_transfer':
                $this->department_transfer = false;
                if ($this->department_transfer_id > 0) {
                    try {
                        $this->department_transfer = self::fetch($this->department_transfer_id, true);
                    } catch (Exception $e) {
                    }
                }
                return $this->department_transfer;
                break;
            case 'start_hour_front':
                return floor($this->start_hour / 100);
                break;
            case 'start_minutes_front':
                return $this->start_hour - $this->start_hour_front * 100;
                break;
            case 'end_hour_front':
                return floor($this->end_hour / 100);
                break;
            case 'end_minutes_front':
                return $this->end_hour - $this->end_hour_front * 100;
                break;
            case 'mod_start_hour_front':
            case 'tud_start_hour_front':
            case 'wed_start_hour_front':
            case 'thd_start_hour_front':
            case 'frd_start_hour_front':
            case 'sad_start_hour_front':
            case 'sud_start_hour_front':
                $startHourName = str_replace('_start_hour_front', '', $var) . '_start_hour';
                return $this->{$startHourName} != -1 ? floor($this->{$startHourName} / 100) : '';
                break;
            case 'mod_start_minutes_front':
            case 'tud_start_minutes_front':
            case 'wed_start_minutes_front':
            case 'thd_start_minutes_front':
            case 'frd_start_minutes_front':
            case 'sad_start_minutes_front':
            case 'sud_start_minutes_front':
                $startHourName = str_replace('_start_minutes_front', '', $var) . '_start_hour';
                $startHourFrontName = str_replace('_start_minutes_front', '', $var) . '_start_hour_front';
                return $this->{$startHourName} != -1 ? $this->{$startHourName} - $this->{$startHourFrontName} * 100 : '';
                break;
            case 'mod_end_hour_front':
            case 'tud_end_hour_front':
            case 'wed_end_hour_front':
            case 'thd_end_hour_front':
            case 'frd_end_hour_front':
            case 'sad_end_hour_front':
            case 'sud_end_hour_front':
                $endHourName = str_replace('_end_hour_front', '', $var) . '_end_hour';
                return $this->{$endHourName} != -1 ? floor($this->{$endHourName} / 100) : '';
                break;
            case 'mod_end_minutes_front':
            case 'tud_end_minutes_front':
            case 'wed_end_minutes_front':
            case 'thd_end_minutes_front':
            case 'frd_end_minutes_front':
            case 'sad_end_minutes_front':
            case 'sud_end_minutes_front':
                $endHourName = str_replace('_end_minutes_front', '', $var) . '_end_hour';
                $endHourFrontName = str_replace('_end_minutes_front', '', $var) . '_end_hour_front';
                return $this->{$endHourName} != -1 ? $this->{$endHourName} - $this->{$endHourFrontName} * 100 : '';
                break;
            default:
                break;
        }
    }