Add new models and page for motions
This commit is contained in:
61
app/Models/Person.php
Normal file
61
app/Models/Person.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Person extends Model
|
||||
{
|
||||
protected $table = 'person';
|
||||
|
||||
protected $primaryKey = 'intressent_id';
|
||||
|
||||
protected $keyType = 'string';
|
||||
|
||||
public $incrementing = false;
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'intressent_id',
|
||||
'född_år',
|
||||
'kön',
|
||||
'efternamn',
|
||||
'tilltalsnamn',
|
||||
'sorteringsnamn',
|
||||
'iort',
|
||||
'parti',
|
||||
'valkrets',
|
||||
'status',
|
||||
];
|
||||
|
||||
public function uppdrag()
|
||||
{
|
||||
return $this->hasMany(PersonUppdrag::class, 'intressent_id', 'intressent_id');
|
||||
}
|
||||
|
||||
public function uppgifter()
|
||||
{
|
||||
return $this->hasMany(PersonUppgift::class, 'intressent_id', 'intressent_id');
|
||||
}
|
||||
|
||||
public function voteringar()
|
||||
{
|
||||
return $this->hasMany(Votering::class, 'intressent_id', 'intressent_id');
|
||||
}
|
||||
|
||||
public function anforanden()
|
||||
{
|
||||
return $this->hasMany(Anforande::class, 'intressent_id', 'intressent_id');
|
||||
}
|
||||
|
||||
public function debatter()
|
||||
{
|
||||
return $this->hasMany(Debatt::class, 'intressent_id', 'intressent_id');
|
||||
}
|
||||
|
||||
public function dokIntressenter()
|
||||
{
|
||||
return $this->hasMany(DokIntressent::class, 'intressent_id', 'intressent_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user