Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Tennisconnect\DashboardBundle\Extension;
- class NotificationTwigExtension extends \Twig_Extension
- {
- protected $doctrine;
- public function __constructor(Registry $doctrine)
- {
- $this->doctrine = $doctrine;
- }
- public function getFriendRequests($user)
- {
- $users = $this->doctrine
- ->getRepository('TennisconnectUserBundle:User')
- ->getFriendRequests();
- return count($users);
- }
- public function getChallengeRequests()
- {
- return 2;
- }
- public function getName()
- {
- return 'notification';
- }
- public function getFunctions()
- {
- return array(
- 'getFriendRequests' => new \Twig_Function_Method($this, 'getFriendRequests'),
- 'getChallengeRequests' => new \Twig_Function_Method($this, 'getChallengeRequests')
- );
- }
- }
Add Comment
Please, Sign In to add comment