mein-sterntours/app/Models/IQContentSite.php
2025-04-01 10:40:14 +02:00

57 lines
2.1 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* App\Models\IQContentSite
*
* @property int $id
* @property int $tree_node_id
* @property int $travel_guide_id
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Models\IQContentTreeNode $iq_content_tree_node
* @property-read \App\Models\TravelGuide $travel_guide
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite whereTravelGuideId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite whereTreeNodeId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite whereUpdatedAt($value)
* @property string|null $identifier
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite whereIdentifier($value)
* @mixin \Eloquent
*/
class IQContentSite extends Model
{
protected $connection = 'mysql_stern';
protected $table = 'i_q_content_sites';
protected $fillable = [
'tree_node_id', 'travel_guide_id', 'identifier',
];
public static $travelTypes = [
''=>'keine',
'long'=>'Lange Version',
'short'=>'Kurze Version',
];
public function iq_content_tree_node()
{
return $this->belongsTo('App\Models\IQContentTreeNode', 'tree_node_id');
}
public function travel_guide()
{
return $this->belongsTo('App\Models\TravelGuide', 'travel_guide_id');
}
public function getTravelType(){
return isset(self::$travelTypes[$this->attributes['identifier']]) ? self::$travelTypes[$this->attributes['identifier']] : "";
}
}