Blame view
app/Queries/Comment/ViewedBy.php
612 Bytes
e77200db5 Initial commit |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<?php namespace FootyRoom\Queries\Comment; use FootyRoom\Core\Comment\CommentPolicy; trait ViewedBy { /** * Sets up query according to user role to make sure right data is * requested. * * @param int $userRole * * @return self */ public function viewedBy($userRole) { if (property_exists($this, 'unpublished')) { $this->unpublished = CommentPolicy::seeUnpublished($userRole); } if (property_exists($this, 'meta')) { $this->meta = CommentPolicy::getVisibleMeta($userRole); } return $this; } } |