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

namespace App\Models\AbstractModels;

abstract class AbstractContenutoBacheca extends \Illuminate\Foundation\Auth\User
{
    /**  
     * The table associated with the model.
     * 
     * @var string
     */
    protected $table = 'contenuto_bacheca';
    
    /**  
     * Primary key type.
     * 
     * @var string
     */
    protected $keyType = 'bigInteger';
    
    /**  
     * The model's default values for attributes.
     * 
     * @var array
     */
    // protected $attributes = ['is_gruppo' => 0];
    
    /**  
     * The attributes that should be cast to native types.
     * 
     * @var array
     */
    protected $casts = [
        'id' => 'integer',  
        'nome' => 'string',
        'descrizione' => 'string',
        'immagine' => 'string',
        'attivita_id' => 'integer',
        'created_at' => 'datetime',
        'updated_at' => 'datetime'
    ];  
    /**  
     * The attributes that are mass assignable.
     * 
     * @var array
     */
    protected $fillable = [
        'id',
        'nome',
        'descrizione',
        'immagine',
        'attivita_id',
        'created_at',
        'updated_at'
    ];

    public function attivita()
    {
        return $this->belongsTo('\App\Models\Attivita', 'attivita_id', 'id');
    }
    public function bacheca_has_contenuto()
    {
        return $this->hasMany('\App\Models\BachecaHasContenuto', 'contenuto_id', 'id');
    }
    public function bacheche()
    {
        return $this->belongsToMany('\App\Models\Bacheca', 'bacheca_has_contenuto', 'contenuto_id', 'bacheca_id');
    }
}
