No Description

Objective.php 866B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. class Objective extends Eloquent
  3. {
  4. protected $fillable = array('text', 'outcome_id', 'program_id', 'active');
  5. /**
  6. * Return the program that the objective belongs to
  7. *
  8. * @return Illuminate\Database\Eloquent\Model
  9. */
  10. public function program()
  11. {
  12. return $this->belongsTo('Program');
  13. }
  14. /**
  15. * Return the outcomes that the objective belongs to
  16. *
  17. * @return Illuminate\Database\Eloquent\Model
  18. */
  19. public function outcomes()
  20. {
  21. return $this->belongsToMany('Outcome', 'objective_outcome', 'objective_id', 'outcome_id');
  22. }
  23. public function outcome()
  24. {
  25. return $this->belongsTo('Outcome');
  26. }
  27. /**
  28. * Return the program that the objective belongs to
  29. *
  30. * @return Illuminate\Database\Eloquent\Model
  31. */
  32. public function criteria()
  33. {
  34. return $this->hasMany('Criterion');
  35. }
  36. }