self = $hooks->wrap( $this ); $this->auth = $hooks->wrap( $auth ); $this->shiftsQuery = $hooks->wrap( $shiftsQuery ); } public function checkView( $shiftId ) { $return = FALSE; $shift = $this->shiftsQuery->findById( $shiftId ); if( ! ($shift && $shift->getId()) ){ return $return; } $currentUser = $this->auth->getCurrentUser(); $currentUserId = $currentUser->getId(); if( ! $currentUserId ){ return $return; } $return = TRUE; return $return; } }