franz-deleon/fdl-gateway-manager 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

franz-deleon/fdl-gateway-manager

Composer 安装命令:

composer require franz-deleon/fdl-gateway-manager

包简介

A ZF2 module use to manage Zend Db gateway instances

README 文档

README

The Gateway Manager is a Zend Framework 2 module designed as a wrapper for Zend\Db\TableGateway\TableGateway so that a developer can easily assemble and manage multiple gateways with ease without cluttering your module.php.

This is useful if you are using mappers, dbtables and entities. The Gateway Manager will automatically inject and map your entities to your dbtables.

Requirements

  • Zend Framework 2.2
  • PHP 5.3

Usage

  1. In your module's module.config.php add:

     // module.config.php inside an array
     'loc_gateway_manager_assets' => array(
         'entities' => 'namespace\to\entity\dir',
         'tables'   => 'namespace\to\tables\dir',
     )
    
  2. Create an entity in your specified 'entities' namespace:

     // Users.php
     namespace namespace\to\entity\dir;
     class Users
     {
         public function getID() ...
         public function setID() ...
         public function getName() ...
         public function setName($name) ...
     }
    

    If you are using a table to create with your mapper

     // UsersTable.php
     namespace namespace\to\tables\dir;
     class UsersTable implements \LocGatewayManager\Gateway\AbstractTable
     {
         $tableName  = 'MY_USERS'; // actual table name in db
         $primaryKey = 'ID' // primary key column
     }
    

    * This table will act as your inteded tablegateway

  3. Use the FactoryManager:

     $gm = $sm->get('LocGatewayManager');
     $tableGateway = $gm->factory(array(
         'entity_name'     => 'Users',
         'result_set_name' => 'HydratingResultSet'
     ), 'users');
     $tableGateway->fetchAll();
     
     // later anywhere where you can have a service manager
     $users = $sm->get('LocGatewayManager')->get('users');
     $users->fetchAll();
    
TODOS:

@todo rename GatewayFactoryProcessor to GatewayFactoryUtilities
@todo add assemble() to WorkerInterface

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-10-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固