aboutsummaryrefslogtreecommitdiff
path: root/app/Verb.php
diff options
context:
space:
mode:
authorCamil Staps2016-09-05 23:43:35 +0200
committerCamil Staps2016-09-05 23:43:35 +0200
commit15b26b8b2af028ea30dc34f78ed5c6f3fcb0d547 (patch)
treee13decabbbe1f50553ea75cdeb50b5bc1496b9a8 /app/Verb.php
parentVote on verb suggestions (diff)
Suggest new verbs
Diffstat (limited to 'app/Verb.php')
-rw-r--r--app/Verb.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/Verb.php b/app/Verb.php
index aa0db26..3ff79fc 100644
--- a/app/Verb.php
+++ b/app/Verb.php
@@ -26,7 +26,7 @@ class Verb extends Model {
public $timestamps = false;
protected $fillable = ['verb', 'root', 'stem', 'tense', 'person', 'gender', 'number'];
- const ACCEPTED_VOTE_COUNT = 1;
+ const ACCEPTED_VOTE_COUNT = 5;
public function actions() {
return $this->hasMany('HebrewParseTrainer\VerbAction');
@@ -56,4 +56,16 @@ class Verb extends Model {
return 0;
}
+ public function suggestedBy() {
+ $suggs = $this->actions()
+ ->where('kind', VerbAction::KIND_SUGGEST)
+ ->get();
+
+ foreach ($suggs as $sugg) {
+ return $sugg->user;
+ }
+
+ return null;
+ }
+
}