Advertisement
RalfEggert

CustomerTable to be tested

Oct 24th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. <?php
  2. namespace Customer\Table;
  3.  
  4. use Customer\Entity\CustomerEntity;
  5. use Customer\Hydrator\CustomerHydrator;
  6. use Zend\Db\Adapter\AdapterInterface;
  7. use Zend\Db\ResultSet\HydratingResultSet;
  8. use Zend\Db\TableGateway\TableGateway;
  9.  
  10. class CustomerTable extends TableGateway
  11. {
  12.     public function __construct(AdapterInterface $adapter)
  13.     {
  14.         $resultSetPrototype = new HydratingResultSet(
  15.             new CustomerHydrator(),
  16.             new CustomerEntity()
  17.         );
  18.  
  19.         parent::__construct('customers', $adapter, null, $resultSetPrototype);
  20.     }
  21.  
  22.     public function fetchList()
  23.     {
  24.         $select = $this->getSql()->select();
  25.  
  26.         return $this->selectWith($select);
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement