This repository has been archived on 2025-08-22. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dumbo/app/models/Film.php
2013-09-08 02:08:27 +02:00

26 lines
543 B
PHP

<?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);
}
}