Sentence.php 557 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Models;
  3. use App\Models\Corpus;
  4. use App\Models\Annotation;
  5. use Illuminate\Database\Eloquent\Model;
  6. class Sentence extends Model {
  7. protected $table = 'sentences';
  8. public $timestamps = true;
  9. public function corpus()
  10. {
  11. return $this->belongsTo('App\Models\Corpus');
  12. }
  13. public function words()
  14. {
  15. return $this->hasMany('App\Models\Word');
  16. }
  17. public function games()
  18. {
  19. return $this->belongsToMany('App\Models\Game');
  20. }
  21. public function is_training()
  22. {
  23. return $this->corpus->is_training;
  24. }
  25. }