SHARE
TWEET

CustomerTable to be tested

RalfEggert Oct 24th, 2013 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top