forked from Spoje-NET/php-abraflexi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjectsCooperation.php
More file actions
37 lines (29 loc) · 953 Bytes
/
ObjectsCooperation.php
File metadata and controls
37 lines (29 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/php -f
<?php
/**
* AbraFlexi - Sharing data and connection options between objects
*
* @author Vítězslav Dvořák <info@vitexsofware.cz>
* @copyright (G) 2017 Vitex Software
*/
namespace Example\AbraFlexi;
include_once './config.php';
include_once '../vendor/autoload.php';
/**
* @var \AbraFlexi\FakturaVydana With initial type code:FAKTURA, connected to
* default constatnt('FLEXIBEE_URL')
*/
$originalInvoice = new \AbraFlexi\FakturaVydana(['typDokl' => \AbraFlexi\RO::code('FAKTURA')]);
/**
* @var \AbraFlexi\FakturaVydana
*/
$invoice = new \AbraFlexi\FakturaVydana($originalInvoice->getData(),
$originalInvoice->getConnectionOptions());
/**
* Save to FlexiBee a obtain processed record record with its new CODE, Number etc.
*/
$invoice->sync();
/**
* Print Link to new record in FlexiBee web interface
*/
echo '<a href="'.$invoice->getApiURL('html').'">'.$invoice.'</a>';