The TableGateway is the basic way to access database by zend-framework2
The tablegateway object is intended to provide an object that represents a table in a database, and the methods of this object mirror the most common operations on a database table.
There are two primary implementations of the tablegatewayinterface that are of the most useful: abstracttablegateway and tablegateway. The abstracttablegateway is an abstract basic implementation that provides functionality for select()
, insert()
, update()
, delete()
, as well as an additional API for doing these same kinds of tasks with explicit sql objects. These methods are selectWith()
, insertWith()
, updateWith()
and deleteWith()
. In addition, abstracttablegateway also implements a “Feature” API, that allows for expanding the behaviors of the base tablegateway implementation without having to extend the class with this new functionality. The tablegateway concrete implementation simply adds a sensible constructor to the abstracttablegateway class so that out-of-the-box, tablegateway does not need to be extended in order to be consumed and utilized to its fullest.