This file contains hidden or 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
| <?php | |
| namespace Application\Model; | |
| class Item | |
| { | |
| public $id; | |
| public $description; | |
| public $done; | |
| public function exchangeArray($data) |
This file contains hidden or 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
| <?php | |
| namespace Application\Model; | |
| use Zend\Db\TableGateway\TableGateway; | |
| use Zend\Db\Sql\Select; | |
| class ItemTable | |
| { | |
| public $tableGateway; |
This file contains hidden or 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
| <?php | |
| return array( | |
| 'controllers' => array( //lista os dois controllers do modulo | |
| 'invokables' => array( | |
| 'rest' => 'Api\Controller\RestController', | |
| ) | |
| ), | |
| 'router' => array( //rotas dos controllers | |
| 'routes' => array( | |
| 'restful' => array( |
This file contains hidden or 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
| public function getServiceConfig() | |
| { | |
| return array( | |
| 'factories' => array( | |
| 'Application\Model\Item' => function($sm) { | |
| return new Item(); | |
| }, | |
| 'ItemTableGateway' => function($sm) { | |
| $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); | |
| $resultSetPrototype = new ResultSet(); |
This file contains hidden or 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
| <?php | |
| return array( | |
| 'item' => array( | |
| 'class' => 'Application\Model\Item', | |
| 'tableGateway' => 'ItemTableGateway', | |
| 'authorization' => 0 | |
| ), | |
| ); |
This file contains hidden or 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
| <?php | |
| /** | |
| * Classe responsável pelo acesso REST das entidades | |
| * | |
| * @category Api | |
| * @package Controller | |
| * @author Elton Minetto <eminetto@coderockr.com> | |
| */ |
This file contains hidden or 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
| /** | |
| * Executada no bootstrap do módulo | |
| * | |
| * @param MvcEvent $e | |
| */ | |
| public function onBootstrap($e) | |
| { | |
| /** @var \Zend\ModuleManager\ModuleManager $moduleManager */ | |
| $moduleManager = $e->getApplication()->getServiceManager()->get('modulemanager'); | |
| /** @var \Zend\EventManager\SharedEventManager $sharedEvents */ |
This file contains hidden or 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
| <?php | |
| namespace Api\PreProcessor; | |
| use Zend\Mvc\MvcEvent; | |
| /** | |
| * Responsável por fazer o pré-processamento das requisições da APi | |
| * | |
| * @category Api |
This file contains hidden or 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
| <?php | |
| namespace Api\PostProcessor; | |
| use Zend\Mvc\MvcEvent; | |
| /** | |
| * Responsável por fazer o pós-processamento das requisições da APi | |
| * | |
| * @category Api | |
| * @package PostProcessor |
This file contains hidden or 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
| <?php | |
| namespace Api\PostProcessor; | |
| /** | |
| * Classe abstrata usada pelos pós-processadores | |
| * | |
| * @category Api | |
| * @package PostProcessor | |
| * @author Elton Minetto<eminetto@coderockr.com> |