-
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
J. Marcelo Aviles Paco
authored and
J. Marcelo Aviles Paco
committed
Feb 3, 2023
1 parent
a16c276
commit d538b8c
Showing
5 changed files
with
156 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
namespace SinticBolivia\MonoInvoicesApi\Classes; | ||
|
||
class Cliente extends SBObject | ||
{ | ||
public $customer_id; | ||
public $code; | ||
public $first_name; | ||
public $last_name; | ||
public $identity_document; | ||
public $phone; | ||
public $email; | ||
public $address_1; | ||
public $meta = []; | ||
|
||
public function __construct() | ||
{ | ||
|
||
} | ||
public function setNitRucNif($nit_ruc_nif) | ||
{ | ||
$this->setMeta('_nit_ruc_nif', $nit_ruc_nif); | ||
} | ||
public function setNombreFacturacion($nombre) | ||
{ | ||
$this->setMeta('_billing_name', $nombre); | ||
} | ||
public function getNitRucNif() | ||
{ | ||
return $this->getMeta('_nit_ruc_nif'); | ||
} | ||
public function getNombreFacturacion() | ||
{ | ||
return $this->getMeta('_billing_name'); | ||
} | ||
/** | ||
* Asigna datos adicionales para el cliente | ||
* | ||
* @param string $key nombre del dato | ||
* @param mixed $value valor del dato | ||
*/ | ||
public function setMeta($key, $value) | ||
{ | ||
$this->meta[$key] = $value; | ||
} | ||
public function getMeta($key, $defVal = null) | ||
{ | ||
if( !isset($this->meta[$key]) ) | ||
return $defVal; | ||
|
||
return $this->meta[$key]; | ||
} | ||
} |
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,17 @@ | ||
<?php | ||
namespace SinticBolivia\MonoInvoicesApi\Classes; | ||
|
||
class SBObject | ||
{ | ||
public function bind($data) | ||
{ | ||
if( !is_array($data) && !is_object($data) ) | ||
return false; | ||
foreach($data as $prop => $val) | ||
{ | ||
if( !property_exists($this, $prop) ) | ||
continue; | ||
$this->$prop = $val; | ||
} | ||
} | ||
} |