updates
This commit is contained in:
1 parent
6d715e4090
commit
5cb555e869
15 files changed
+1358
-5
No files matched your search
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
class Film extends Eloquent {
|
||||
protected $table = "films";
|
||||
|
||||
public function comments() {
|
||||
return $this->hasMany('Comment', 'film');
|
||||
}
|
||||
|
||||
public function votes() {
|
||||
return $this->hasMany('Vote', 'film');
|
||||
}
|
||||
|
||||
public function besitzer() {
|
||||
return $this->belongsTo('User', 'user');
|
||||
}
|
||||
|
||||
public function scopeZuletztGesehen($query) {
|
||||
return $query->whereNotNull('gesehen')->orderBy('gesehen')->take(5);
|
||||
}
|
||||
|
||||
public function scopeNeuesteVorschlage($query) {
|
||||
return $query->whereNull('gesehen')->orderBy('updated_at')->take(5);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user