public function buildPreAttachements() { $name = 'uploads/FAC' . $this->getBill()->getNumber() . '.pdf'; Bill::save(array($this->getBill()), true, $name); $file = new UploadedFile($name, 'FAC' . $this->getBill()->getNumber() . '.pdf', 'application/pdf'); $this->getMail()->addPreAttachement($file); }
public function buildPreAttachements() { foreach ($this->getBusiness()->getUnpayedBills() as $bill) { $name = 'uploads/FAC' . $bill->getNumber() . '.pdf'; Bill::save(array($bill), true, $name); $file = new UploadedFile($name, 'FAC' . $bill->getNumber() . '.pdf', 'application/pdf'); $this->getMail()->addPreAttachement($file); } }
<?php use JLM\CommerceBundle\Pdf\Bill; echo Bill::get($entities, $duplicate);