1. Go to this page and download the library: Download bauer01/unimapper-flexibee library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
public function createTestOrder()
{
$order = new Order;
$order->documentType = Order::DOCTYPE_CONSIGNMENT;
$order->addressBookId = "code:FIRMA";
$items = [];
$item = new EvidenceItem; // entita vázaná na evidenci "objednavka-prijata-polozka"
$item->itemPriceList = "code:KRABICE_DROG"; // property objednavka-prijata-polozka.cenik
$item->itemAmount = 2.0; // property objednavka-prijata-polozka.mnozMj
$items[] = $item;
$item = new EvidenceItem;
$item->itemPriceList = "code:KRABICE_ALKOHOLU";
$item->itemAmount = 1.0;
$items[] = $item;
$order->evidenceItems = new \UniMapper\EntityCollection(
"EvidenceItem", $items
);
$this->save($order);
// v $order->id budu mít v tento moment identifikátor objednávky z Flexibee, tj. třeba "code:OBP0001/2015"
}
public function getOrderPdf($orderId)
{
return $this->getAdapter("Flexibee")->get(
"objednavka-vydana/" . rawurlencode($orderId) . ".pdf",
"application/pdf"
);
}
public function getOrder($orderId)
{
$query = $this->query()->selectOne($orderId)->associate(["advanceInvoices", "cashInvoices"]);
$order = $query->run($this->connection);
return $order;
}
$order = $this->orderRepository->findOne("code:OBP0001/2015);
...
nějaké ty operace
...
$order->status = "stavDoklObch.hotovo";
$this->orderRepository->save($order);
$order = $this->orderRepository->findOne("code:OBP0001/2015);
...
nějaké ty operace
...
$this->orderRepository->save(
new ProjectName\Entity\Order(
["id" => $order->id, "status" => "stavDoklObch.hotovo"]
)
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.