<?php


namespace App\Models\LocalizationManagement;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;

class ModelHasAddress extends Model {

    protected $table = "localization_mgt__model_has_addresses";
    protected $guarded = [];
    const MORPH_ID_COLUMN = "addressable_id";
    const MORPH_TYPE_COLUMN = "addressable_type";
    const MORPH_FUNCTION_NAME = "addressable";


    /** Le Payeur
     * @return MorphTo
     */
    public function addressable(){
        return $this->morphTo(__FUNCTION__,
            self::MORPH_TYPE_COLUMN,self::MORPH_ID_COLUMN);
    }
}
