<?php
/**
 * Model object generated by: Skipper (http://www.skipper18.com)
 * Do not modify this file manually.
 */

namespace App\Models\AbstractModels;

use Illuminate\Database\Eloquent\Model;

abstract class AbstractAzienda extends Model
{
    /**  
     * The table associated with the model.
     * 
     * @var string
     */
    protected $table = 'azienda';
    
    /**  
     * Primary key type.
     * 
     * @var string
     */
    protected $keyType = 'bigInteger';
    
    /**  
     * The attributes that should be cast to native types.
     * 
     * @var array
     */
    protected $casts = [
        'id' => 'integer',
        'ragione_sociale' => 'string',
        'intestazione' => 'string',
        'is_attivo' => 'boolean',
        'path_logo' => 'string',
        'redmine_url' => 'string',
        'default' => 'boolean',
        'created_at' => 'datetime',
        'updated_at' => 'datetime'
    ];
    
    /**  
     * The attributes that are mass assignable.
     * 
     * @var array
     */
    protected $fillable = [
        'id',
        'ragione_sociale',
        'intestazione',
        'is_attivo',
        'path_logo',
        'redmine_url',
        'default',
        'created_at',
        'updated_at'
    ];
    
    public function configs()
    {
        return $this->hasMany('\App\Models\Config', 'azienda_id', 'id');
    }
    
    public function users()
    {
        return $this->hasMany('\App\Models\User', 'azienda_id', 'id');
    }
}
