| Total Complexity | 3 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class LayoutFeatures extends Model |
||
| 15 | { |
||
| 16 | private $_feedback; |
||
| 17 | private $_comments; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Process all database query before init |
||
| 21 | */ |
||
| 22 | public function before() |
||
| 23 | { |
||
| 24 | $this->_feedback = FeedbackPost::where('closed', false) |
||
| 25 | ->where('readed', false) |
||
| 26 | ->orderBy('id', 'DESC') |
||
| 27 | ->take(10) |
||
| 28 | ->get(); |
||
| 29 | |||
| 30 | $this->_comments = CommentPost::orderBy('id', 'DESC') |
||
| 31 | ->take(10) |
||
| 32 | ->get(); |
||
| 33 | |||
| 34 | parent::before(); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Get feedback post array |
||
| 39 | * @return FeedbackPost[]|Collection |
||
| 40 | */ |
||
| 41 | public function getFeedback() |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Get comment post array |
||
| 48 | * @return CommentPost|Collection |
||
| 49 | */ |
||
| 50 | public function getComments() |
||
| 53 | } |
||
| 54 | } |