diff --git a/Entity/Invoice.php b/Entity/Invoice.php index 130f1a7..36c2eb7 100644 --- a/Entity/Invoice.php +++ b/Entity/Invoice.php @@ -293,7 +293,7 @@ class Invoice extends CollmexObject */ protected $position_type; /** - * @ORM\Column(type="integer") + * @ORM\Column(type="string") */ protected $product_id; /** diff --git a/Entity/Product.php b/Entity/Product.php index 45b1b45..28e9b37 100644 --- a/Entity/Product.php +++ b/Entity/Product.php @@ -267,36 +267,24 @@ class Product extends CollmexObject * @ORM\Column(type="string") */ protected $goods_number; - /** - * @ORM\Column(type="string") - */ - protected $extraInfo; - - - - public function setField($key, $value) - { - $this->template[$key] = $value; - - if ($key == 'remark') { - $this->parseRemark(); - } - } + public function getExtraInfo() { - return $this->extraInfo; + return $this->parseRemark(); } public function parseRemark() { $remark = $this->getField('remark'); - preg_match_all("/(\[)(.*?)(\])/", $remark, $aMatches); - + $array = array(); + foreach ($aMatches[2] as $match) { $parameters = explode('=', $match); - $this->extraInfo[$parameters[0]] = $parameters[1]; + $array[$parameters[0]] = $parameters[1]; } + + return $array; } } \ No newline at end of file diff --git a/Services/CollmexManager.php b/Services/CollmexManager.php index 7fa5413..c30ce23 100644 --- a/Services/CollmexManager.php +++ b/Services/CollmexManager.php @@ -185,7 +185,7 @@ public function getInvoice($invoiceNo = null, $customerNo = null, $from = null, return $response->getObjects()[0]; } - + public function getInvoices($customerNo = null, $from = null, $to = null, $onlyIssued = 0, $onlyModified = 0, $onlyCreatedWithThisAPI = 0, $companyId = 1) { $request = new Request([ @@ -208,6 +208,7 @@ public function getInvoices($customerNo = null, $from = null, $to = null, $onlyI return $response->getObjects(); } + } \ No newline at end of file