Exemple #1
0
 /**
  * 
  * @param NpdSheet $npd
  * @param SapSupplier $supplier
  * @param Color $color
  * @return array
  */
 public function toArrayForList()
 {
     if (!empty($this->idNpdSheet)) {
         $npd = NpdSheetQuery::create()->findByPK($this->getIdNpdSheet());
     }
     if (!$npd instanceof NpdSheet) {
         $npd = new NpdSheet();
     }
     if (!empty($this->idSupplier)) {
         $supplier = SapSupplierQuery::create()->findByPK($this->getIdSupplier());
     }
     if (!$supplier instanceof SapSupplier) {
         $supplier = new SapSupplier();
     }
     if (!empty($this->idColor)) {
         $color = ColorQuery::create()->findByPK($this->getIdColor());
     }
     if (!$color instanceof Color) {
         $color = new Color();
     }
     return array('npd_status' => $npd->getStatusName(), 'name' => utf8_encode($npd->getName()), 'reference' => utf8_encode($npd->getReference()), 'supplier' => utf8_encode($supplier->getName()), 'color' => utf8_encode($color->getName()), 'id_sample' => $this->getIdSample(), 'id_npd_sheet' => $this->getIdNpdSheet(), 'quantity' => $this->getQuantity(), 'folio' => $this->getFolio(), 'notes' => utf8_encode($this->getNotes()), 'status' => $this->getStatus(), 'status_name' => $this->getStatusName(), 'deadline' => $this->getDeadline(), 'shipped_quantity' => $this->getShippedQuantity(), 'is_ordered' => $this->isOrdered(), 'is_requested_to_supplier' => $this->isRequestedToSupplier(), 'is_sent' => $this->isSent());
 }