generated from spatie/package-skeleton-php
-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from marcovr1980/feat-getsaldi
- Loading branch information
Showing
4 changed files
with
244 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?php | ||
|
||
namespace IntVent\EBoekhouden\Filters; | ||
|
||
use DateTime; | ||
|
||
class SaldiFilter | ||
{ | ||
protected int $cost_placement_id = 0; | ||
protected ?DateTime $date_from = null; | ||
protected ?DateTime $date_to = null; | ||
protected string $category = ''; | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getCostPlacementId(): int | ||
{ | ||
return $this->cost_placement_id; | ||
} | ||
|
||
/** | ||
* @param int $cost_placement_id | ||
* @return SaldiFilter | ||
*/ | ||
public function setCostPlacementId(int $cost_placement_id): SaldiFilter | ||
{ | ||
$this->cost_placement_id = $cost_placement_id; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return DateTime|null | ||
*/ | ||
public function getDateFrom(): ?DateTime | ||
{ | ||
return $this->date_from; | ||
} | ||
|
||
/** | ||
* @param DateTime|null $date_from | ||
* @return SaldiFilter | ||
*/ | ||
public function setDateFrom(?DateTime $date_from): SaldiFilter | ||
{ | ||
$this->date_from = $date_from; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return DateTime|null | ||
*/ | ||
public function getDateTo(): ?DateTime | ||
{ | ||
return $this->date_to; | ||
} | ||
|
||
/** | ||
* @param DateTime|null $date_to | ||
* @return SaldiFilter | ||
*/ | ||
public function setDateTo(?DateTime $date_to): SaldiFilter | ||
{ | ||
$this->date_to = $date_to; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getCategory(): string | ||
{ | ||
return $this->category; | ||
} | ||
|
||
/** | ||
* @param string $category | ||
* @return SaldiFilter | ||
*/ | ||
public function setCategory(string $category): SaldiFilter | ||
{ | ||
$this->category = $category; | ||
|
||
return $this; | ||
} | ||
} |
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,107 @@ | ||
<?php | ||
|
||
namespace IntVent\EBoekhouden\Models; | ||
|
||
use IntVent\EBoekhouden\Contracts\Arrayable; | ||
use IntVent\EBoekhouden\Traits\ProtectedFieldsToArrayTrait; | ||
|
||
class EboekhoudenBalance implements Arrayable | ||
{ | ||
use ProtectedFieldsToArrayTrait; | ||
|
||
protected int $id = 0; | ||
protected string $code = ''; | ||
protected string $category = ''; | ||
protected float $balance; | ||
|
||
/** | ||
* EboekhoudenBalance constructor. | ||
* @param array|null $item | ||
*/ | ||
public function __construct(array $item = null) | ||
{ | ||
if (! empty($item)) { | ||
$this | ||
->setId($item['ID']) | ||
->setCode($item['Code']) | ||
->setCategory($item['Categorie']) | ||
->setBalance($item['Saldo']); | ||
} | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getId(): int | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* @param int $id | ||
* @return EboekhoudenBalance | ||
*/ | ||
public function setId(int $id): EboekhoudenBalance | ||
{ | ||
$this->id = $id; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getCode(): string | ||
{ | ||
return $this->code; | ||
} | ||
|
||
/** | ||
* @param string $code | ||
* @return EboekhoudenBalance | ||
*/ | ||
public function setCode(string $code): EboekhoudenBalance | ||
{ | ||
$this->code = $code; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getCategory(): string | ||
{ | ||
return $this->category; | ||
} | ||
|
||
/** | ||
* @param string $category | ||
* @return EboekhoudenBalance | ||
*/ | ||
public function setCategory(string $category): EboekhoudenBalance | ||
{ | ||
$this->category = $category; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return float | ||
*/ | ||
public function getBalance(): float | ||
{ | ||
return $this->balance; | ||
} | ||
|
||
/** | ||
* @param string $balance | ||
* @return EboekhoudenBalance | ||
*/ | ||
public function setBalance(float $balance): EboekhoudenBalance | ||
{ | ||
$this->balance = $balance; | ||
|
||
return $this; | ||
} | ||
} |