<commit_before><?php

namespace App;

use Illuminate\Database\Eloquent\Model;

use App\Events\SluggableCreating;
use App\GASModel;
use App\SluggableID;

class Contact extends Model
{
    use GASModel, SluggableID;

    public $incrementing = false;

    protected $events = [
        'creating' => SluggableCreating::class,
    ];

    public function target()
    {
        return $this->morphTo();
    }

    public function getSlugID()
    {
        return sprintf('%s::%s-%s', $this->target_id, $this->type, str_random(10));
    }

    public function getTypeNameAttribute()
    {
        $types = Contact::types();
        foreach($types as $t)
            if ($t['value'] == $this->type)
                return $t['label'];

        return '???';
    }

    public static function types()
    {
        return [
            [
                'label' => _i('Indirizzo'),
                'value' => 'address'
            ],
            [
                'label' => _i('E-Mail'),
                'value' => 'email'
            ],
            [
                'label' => _i('Telefono'),
                'value' => 'phone'
            ],
            [
                'label' => _i('Cellulare'),
                'value' => 'mobile'
            ],
            [
                'label' => _i('Fax'),
                'value' => 'fax'
            ],
            [
                'label' => _i('Sito Web'),
                'value' => 'website'
            ],
            [
                'label' => _i('Referente'),
                'value' => 'referent'
            ],
        ];
    }
}<commit_msg>spostato riferimento per tipo contatto<commit_after><?php

namespace App;

use Illuminate\Database\Eloquent\Model;

use App\Events\SluggableCreating;
use App\GASModel;
use App\SluggableID;

class Contact extends Model
{
    use GASModel, SluggableID;

    public $incrementing = false;

    protected $events = [
        'creating' => SluggableCreating::class,
    ];

    public function target()
    {
        return $this->morphTo();
    }

    public function getSlugID()
    {
        return sprintf('%s::%s-%s', $this->target_id, $this->type, str_random(10));
    }

    public function getTypeNameAttribute()
    {
        $types = Contact::types();
        foreach($types as $t)
            if ($t['value'] == $this->type)
                return $t['label'];

        return '???';
    }

    public static function types()
    {
        return [
            [
                'label' => _i('Indirizzo'),
                'value' => 'address'
            ],
            [
                'label' => _i('Referente'),
                'value' => 'referent'
            ],
            [
                'label' => _i('E-Mail'),
                'value' => 'email'
            ],
            [
                'label' => _i('Telefono'),
                'value' => 'phone'
            ],
            [
                'label' => _i('Cellulare'),
                'value' => 'mobile'
            ],
            [
                'label' => _i('Fax'),
                'value' => 'fax'
            ],
            [
                'label' => _i('Sito Web'),
                'value' => 'website'
            ],
        ];
    }
}
{'fraction_non_alphanumeric': 0.1520322680732237, 'fraction_numerical': 0.0012410797393732546, 'mean_word_length': 1.2784452296819788, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, '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': '1029143', 'n_tokens_mistral': 984, 'n_tokens_neox': 936, 'n_words': 176}