Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class PackageManifestGenerator extends Nette\Object
- {
- private $db;
- private $postMethod;
- private $tablesGen;
- public function __construct($db, PostMethodProvider $postMethod, PHPExcel $tablesGen)
- {
- $this->db = $db;
- $this->postMethod = $postMethod;
- $this->tablesGen = $tablesGen;
- }
- public function generate($from, $to)
- {
- $data = array();
- $packages = $this->db->table(...)->where($from, $to);
- foreach ($packages as $package) {
- $postMethod = $this->postMethod->get($packageId);
- $row = array(
- ...,
- $package->senderName,
- ...
- );
- $data[] = $row;
- }
- // ...
- $xls = $this->tables->generate($data); // uz si nepamatuju to api
- return new XlsResponse($xls);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment