Skip to content

Commit

Permalink
Merge branch 'release/0.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
hswong3i committed Nov 24, 2014
2 parents fcd58a7 + 89cf660 commit 8f88412
Show file tree
Hide file tree
Showing 34 changed files with 2,265 additions and 71 deletions.
43 changes: 43 additions & 0 deletions Controller/DeviceController.php
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);
}
}
43 changes: 43 additions & 0 deletions Controller/MessageController.php
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);
}
}
33 changes: 33 additions & 0 deletions Controller/PushController.php
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);
}
}
43 changes: 43 additions & 0 deletions Controller/ServiceController.php
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);
}
}
63 changes: 63 additions & 0 deletions Entity/AbstractEntityRepository.php
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;
}
}
147 changes: 147 additions & 0 deletions Entity/Device.php
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;
}
}
Loading

0 comments on commit 8f88412

Please sign in to comment.