forked from WycliffeAssociates/en_btr_backend
Setup LexicalEntry model and new relationships
This commit is contained in:
parent
a263e62bab
commit
24b4407fe1
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LexicalEntry extends Model
|
||||
{
|
||||
public $incrementing = false;
|
||||
|
||||
public $table = 'lexical_entries';
|
||||
|
||||
public $fillable = [
|
||||
'id',
|
||||
'lemma',
|
||||
'commentary',
|
||||
];
|
||||
|
||||
public $visible = [
|
||||
'id',
|
||||
'lemma',
|
||||
'commentary',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function words()
|
||||
{
|
||||
return $this->hasMany(Word::class, 'strongs_number');
|
||||
}
|
||||
}
|
|
@ -34,4 +34,9 @@ class Word extends Model
|
|||
{
|
||||
return $this->belongsTo(Word::class);
|
||||
}
|
||||
|
||||
public function lexicalEntry()
|
||||
{
|
||||
return $this->belongsTo(LexicalEntry::class, 'id', 'strongs_number');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue