-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff70ce4
commit f7d2899
Showing
8 changed files
with
377 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace BecosoftApi\Entity; | ||
|
||
/** | ||
* Class Weborder | ||
* @package BecosoftApi\Entity | ||
*/ | ||
class Weborder extends AbstractEntity implements EntityInterface | ||
{ | ||
protected static $endpoint = 'Weborder'; | ||
protected static $idField = 'orderID'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace BecosoftApi\Model; | ||
|
||
use Illuminate\Support\Collection; | ||
|
||
/** | ||
* Class AbstractModel | ||
* @package BecosoftApi\Model | ||
*/ | ||
abstract class AbstractModel | ||
{ | ||
/** | ||
* @return array | ||
* @todo Refactor this | ||
*/ | ||
public function toArray() | ||
{ | ||
$values = call_user_func('get_object_vars', $this); | ||
|
||
foreach($values as $key => $value) { | ||
if (!$value instanceof Collection) { | ||
continue; | ||
} | ||
|
||
foreach($value as $subKey => $subValue) { | ||
if (!is_array($subValue)) { | ||
$subValue = $subValue->toArray(); | ||
} | ||
|
||
$values[$key][$subKey] = $subValue; | ||
} | ||
} | ||
|
||
return array_filter($values, function ($item) { | ||
if ($item instanceof Collection) { | ||
return !$item->isEmpty(); | ||
} | ||
|
||
return !is_null($item); | ||
}); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function toJson() | ||
{ | ||
return json_encode($this->toArray()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
<?php | ||
|
||
namespace BecosoftApi\Model; | ||
|
||
use Illuminate\Support\Collection; | ||
|
||
/** | ||
* Class Weborder | ||
* @package BecosoftApi\Model | ||
*/ | ||
class Weborder extends AbstractModel | ||
{ | ||
/** | ||
* @var int | ||
*/ | ||
public $WeborderId; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $Klantnummer; | ||
|
||
/** | ||
* @var \DateTime | ||
*/ | ||
public $Datum; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $verkoper; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
public $Afgehandeld; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $opmerkingorder; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $leveringsadres; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $ordertype; | ||
|
||
/** | ||
* @var float | ||
*/ | ||
public $totaal; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $verzendtype; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $kortingcode; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $LeveradresNaam; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $LeveradresStraat; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $LeveradresExtraAdreslijn; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $LeveradresLand; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $LeveradresPostcode; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $LeveradresPlaats; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $LeveradresHuisnummer; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $LeveradresBus; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $Email; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $ecomklantid; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $ecomRemark; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $ecomCurrency; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $kialaPointID; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $kialaName; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
public $avondlevering; | ||
|
||
/** | ||
* @var Collection|WeborderDetail[] | ||
*/ | ||
public $Details; | ||
|
||
/** | ||
* @var Collection|WeborderPayment[] | ||
*/ | ||
public $Payments; | ||
|
||
/** | ||
* Weborder constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->Details = new Collection(); | ||
$this->Payments = new Collection(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace BecosoftApi\Model; | ||
|
||
/** | ||
* Class WeborderDetail | ||
* @package BecosoftApi\Model | ||
*/ | ||
class WeborderDetail extends AbstractModel | ||
{ | ||
/** | ||
* @var int | ||
*/ | ||
public $aantal; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $artikelnummer; | ||
|
||
/** | ||
* @var float | ||
*/ | ||
public $verkoopprijs; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $voorraadlocatie; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $retourcode; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $retourreden; | ||
} |
Oops, something went wrong.