Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Customer\Table;
- use Customer\Entity\CustomerEntity;
- use Customer\Hydrator\CustomerHydrator;
- use Zend\Db\Adapter\AdapterInterface;
- use Zend\Db\ResultSet\HydratingResultSet;
- use Zend\Db\TableGateway\TableGateway;
- class CustomerTable extends TableGateway
- {
- public function __construct(AdapterInterface $adapter)
- {
- $resultSetPrototype = new HydratingResultSet(
- new CustomerHydrator(),
- new CustomerEntity()
- );
- parent::__construct('customers', $adapter, null, $resultSetPrototype);
- }
- public function fetchList()
- {
- $select = $this->getSql()->select();
- return $this->selectWith($select);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement