2017 © Pedro Peláez
 

library db-layer

Zend Framework 2 DB Layer providing easy access to DB without the need of a model , it returning a ResultSet

image

danmarinescu/db-layer

Zend Framework 2 DB Layer providing easy access to DB without the need of a model , it returning a ResultSet

  • Sunday, July 12, 2015
  • by danmarinescu79
  • Repository
  • 1 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Build Status Scrutinizer Code Quality Build Status Code Coverage Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

DbLayer - README

Name: DbLayer Version: 1.0 Release date: 2015-07-11 Author: Dan Marinescu, (*2)

Copyright (c) 2015: Dan Marinescu, (*3)

Description: DbLayer is a PHP collection of classes for quering databases in ZendFramework2 on-the-fly without requiring extensions such as models or entities., (*4)

Layer Use:, (*5)

Get intsnace of a DB Table :

    $tableInstance = $this->getServiceLocator()->get('DbLayerService')->get($tableName);

Method's provided by the $tableInstance :
    Select :
    $tableInstance->select()->fetchAll();
        Returning all records from a DB Table.

    $tableInstance->select()->fetchOne();
        Returning a single record from a DB Table.

    $tableInstance->select()->fetchPaginated($paginator);
        Returning paginated records from a DB Table ready to use with ZF2 pagination view helper.


    $tableInstance->insert($data);

    $tableInstance->update($data, $where);

    $data = array(
        'TableColumn' => 'TableValue',
        'TableColumn2' => 'TableValue2',
    );

    $tableInstance->delete($where);

    Layer instance methods :

        select($where) accepts an array with WHERE predicate conditions
            $where = array(
                'id = ?' => $id
            );

        join($join) accepts an array for joining other tables
            $join = array(
                array(
                    'table_name' => 'JoinedTable',
                    'join_condition' => 'Table.Id = JoinedTable.TableId',
                    'columns' => array('JoinedTableColumn', 'AliasedTableName' => 'JoinedTableColumn2'),
                    'join' => 'left',
                ),
                array(
                    'table_name' => 'JoinedTable',
                    'join_condition' => 'Table.Id = TableAliasName.TableId',
                    'columns' => array('JoinedTableAliasNameColumn', 'AliasedTableName' => 'JoinedTableAliasNameColumn2'),
                    'join' => 'left',
                    'alias' => 'TableAliasName'
                ),
            );

        limit(2) limiting results returned to 2

        order($order) ordering results
            $order = array(
                'Table.Id' => 'ASC',
                'JoinedTable.TableId' => 'DESC',
            );

        having($having)

        group($group)

Main Features:, (*6)

Installation : composer require danmarinescu/db-layer, (*7)

License: Copyright (C) 2015 Dan Marinescu, (*8)

DbLayer is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

DbLayer is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.

============================================================, (*9)

The Versions

12/07 2015

dev-master

9999999-dev http://marinescudan79.github.io/DbLayer

Zend Framework 2 DB Layer providing easy access to DB without the need of a model , it returning a ResultSet

  Sources   Download

MIT

The Requires

 

database zf2 zend framework 2 layer

12/07 2015

1.1

1.1.0.0 http://marinescudan79.github.io/DbLayer

Zend Framework 2 DB Layer providing easy access to DB without the need of a model , it returning a ResultSet

  Sources   Download

MIT

The Requires

 

database zf2 zend framework 2 layer

12/07 2015

1.0.1

1.0.1.0 http://marinescudan79.github.io/DbLayer

Zend Framework 2 DB Layer providing easy access to DB without the need of a model , it returning a ResultSet

  Sources   Download

MIT

The Requires

 

database zf2 zend framework 2 layer

11/07 2015

1.0

1.0.0.0

Zend Framework 2 DB Layer providing easy access to DB without the need of a model , it returning a ResultSet

  Sources   Download

The Requires