-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
2,265 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the authbucket/push-symfony-bundle package. | ||
* | ||
* (c) Wong Hoi Sing Edison <hswong3i@pantarei-design.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace AuthBucket\Bundle\PushBundle\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
class DeviceController extends Controller | ||
{ | ||
public function createAction(Request $request) | ||
{ | ||
return $this->get('authbucket_push.device_controller')->createAction($request); | ||
} | ||
|
||
public function readAction(Request $request, $id) | ||
{ | ||
return $this->get('authbucket_push.device_controller')->readAction($request, $id); | ||
} | ||
|
||
public function updateAction(Request $request, $id) | ||
{ | ||
return $this->get('authbucket_push.device_controller')->updateAction($request, $id); | ||
} | ||
|
||
public function deleteAction(Request $request, $id) | ||
{ | ||
return $this->get('authbucket_push.device_controller')->deleteAction($request, $id); | ||
} | ||
|
||
public function listAction(Request $request) | ||
{ | ||
return $this->get('authbucket_push.device_controller')->listAction($request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the authbucket/push-symfony-bundle package. | ||
* | ||
* (c) Wong Hoi Sing Edison <hswong3i@pantarei-design.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace AuthBucket\Bundle\PushBundle\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
class MessageController extends Controller | ||
{ | ||
public function createAction(Request $request) | ||
{ | ||
return $this->get('authbucket_push.message_controller')->createAction($request); | ||
} | ||
|
||
public function readAction(Request $request, $id) | ||
{ | ||
return $this->get('authbucket_push.message_controller')->readAction($request, $id); | ||
} | ||
|
||
public function updateAction(Request $request, $id) | ||
{ | ||
return $this->get('authbucket_push.message_controller')->updateAction($request, $id); | ||
} | ||
|
||
public function deleteAction(Request $request, $id) | ||
{ | ||
return $this->get('authbucket_push.message_controller')->deleteAction($request, $id); | ||
} | ||
|
||
public function listAction(Request $request) | ||
{ | ||
return $this->get('authbucket_push.message_controller')->listAction($request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the authbucket/push-symfony-bundle package. | ||
* | ||
* (c) Wong Hoi Sing Edison <hswong3i@pantarei-design.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace AuthBucket\Bundle\PushBundle\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
class PushController extends Controller | ||
{ | ||
public function registerAction(Request $request) | ||
{ | ||
return $this->get('authbucket_push.push_controller')->registerAction($request); | ||
} | ||
|
||
public function unregisterAction(Request $request) | ||
{ | ||
return $this->get('authbucket_push.push_controller')->unregisterAction($request); | ||
} | ||
|
||
public function sendAction(Request $request) | ||
{ | ||
return $this->get('authbucket_push.push_controller')->sendAction($request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the authbucket/push-symfony-bundle package. | ||
* | ||
* (c) Wong Hoi Sing Edison <hswong3i@pantarei-design.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace AuthBucket\Bundle\PushBundle\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
class ServiceController extends Controller | ||
{ | ||
public function createAction(Request $request) | ||
{ | ||
return $this->get('authbucket_push.service_controller')->createAction($request); | ||
} | ||
|
||
public function readAction(Request $request, $id) | ||
{ | ||
return $this->get('authbucket_push.service_controller')->readAction($request, $id); | ||
} | ||
|
||
public function updateAction(Request $request, $id) | ||
{ | ||
return $this->get('authbucket_push.service_controller')->updateAction($request, $id); | ||
} | ||
|
||
public function deleteAction(Request $request, $id) | ||
{ | ||
return $this->get('authbucket_push.service_controller')->deleteAction($request, $id); | ||
} | ||
|
||
public function listAction(Request $request) | ||
{ | ||
return $this->get('authbucket_push.service_controller')->listAction($request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the authbucket/push-symfony-bundle package. | ||
* | ||
* (c) Wong Hoi Sing Edison <hswong3i@pantarei-design.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace AuthBucket\Bundle\PushBundle\Entity; | ||
|
||
use AuthBucket\Push\Model\ModelInterface; | ||
use AuthBucket\Push\Model\ModelManagerInterface; | ||
use Doctrine\ORM\EntityRepository; | ||
|
||
/** | ||
* AbstractEntityRepository | ||
* | ||
* This class was generated by the Doctrine ORM. Add your own custom | ||
* repository methods below. | ||
*/ | ||
class AbstractEntityRepository extends EntityRepository implements ModelManagerInterface | ||
{ | ||
public function createModel(ModelInterface $model) | ||
{ | ||
$this->getEntityManager()->persist($model); | ||
$this->getEntityManager()->flush(); | ||
|
||
return $model; | ||
} | ||
|
||
public function readModelAll() | ||
{ | ||
return $this->findAll(); | ||
} | ||
|
||
public function readModelBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | ||
{ | ||
return $this->findBy($criteria, $orderBy, $limit, $offset); | ||
} | ||
|
||
public function readModelOneBy(array $criteria, array $orderBy = null) | ||
{ | ||
return $this->findOneBy($criteria, $orderBy); | ||
} | ||
|
||
public function updateModel(ModelInterface $model) | ||
{ | ||
$this->getEntityManager()->flush(); | ||
|
||
return $model; | ||
} | ||
|
||
public function deleteModel(ModelInterface $model) | ||
{ | ||
$this->getEntityManager()->remove($model); | ||
$this->getEntityManager()->flush(); | ||
|
||
return $model; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the authbucket/push-symfony-bundle package. | ||
* | ||
* (c) Wong Hoi Sing Edison <hswong3i@pantarei-design.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace AuthBucket\Bundle\PushBundle\Entity; | ||
|
||
use AuthBucket\Push\Model\DeviceInterface; | ||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* Device | ||
* | ||
* @ORM\MappedSuperclass(repositoryClass="AuthBucket\Bundle\PushBundle\Entity\DeviceRepository") | ||
*/ | ||
abstract class Device implements DeviceInterface | ||
{ | ||
/** | ||
* @var string | ||
* | ||
* @ORM\Column(name="device_token", type="string", length=255) | ||
*/ | ||
protected $deviceToken; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @ORM\Column(name="service_id", type="string", length=255) | ||
*/ | ||
protected $serviceId; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @ORM\Column(name="username", type="string", length=255) | ||
*/ | ||
protected $username; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @ORM\Column(name="scope", type="array") | ||
*/ | ||
protected $scope; | ||
|
||
/** | ||
* Set deviceToken | ||
* | ||
* @param string $deviceToken | ||
* | ||
* @return Device | ||
*/ | ||
public function setDeviceToken($deviceToken) | ||
{ | ||
$this->deviceToken = $deviceToken; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Get deviceToken | ||
* | ||
* @return string | ||
*/ | ||
public function getDeviceToken() | ||
{ | ||
return $this->deviceToken; | ||
} | ||
|
||
/** | ||
* Set serviceId | ||
* | ||
* @param string $serviceId | ||
* | ||
* @return Device | ||
*/ | ||
public function setServiceId($serviceId) | ||
{ | ||
$this->serviceId = $serviceId; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Get serviceId | ||
* | ||
* @return string | ||
*/ | ||
public function getServiceId() | ||
{ | ||
return $this->serviceId; | ||
} | ||
|
||
/** | ||
* Set username | ||
* | ||
* @param string $username | ||
* | ||
* @return Device | ||
*/ | ||
public function setUsername($username) | ||
{ | ||
$this->username = $username; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Get username | ||
* | ||
* @return string | ||
*/ | ||
public function getUsername() | ||
{ | ||
return $this->username; | ||
} | ||
|
||
/** | ||
* Set scope | ||
* | ||
* @param array $scope | ||
* | ||
* @return Device | ||
*/ | ||
public function setScope($scope) | ||
{ | ||
$this->scope = $scope; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Get scope | ||
* | ||
* @return array | ||
*/ | ||
public function getScope() | ||
{ | ||
return $this->scope; | ||
} | ||
} |
Oops, something went wrong.