/home/desid573/public_html/payment/xero-2/lib/Models/Accounting
Edit: /home/desid573/public_html/payment/xero-2/lib/Models/Accounting/BudgetBalance.php (9446B)
'string',
'amount' => 'double',
'unit_amount' => 'double',
'notes' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $openAPIFormats = [
'period' => null,
'amount' => 'double',
'unit_amount' => 'double',
'notes' => null
];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function openAPITypes()
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function openAPIFormats()
{
return self::$openAPIFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'period' => 'Period',
'amount' => 'Amount',
'unit_amount' => 'UnitAmount',
'notes' => 'Notes'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'period' => 'setPeriod',
'amount' => 'setAmount',
'unit_amount' => 'setUnitAmount',
'notes' => 'setNotes'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'period' => 'getPeriod',
'amount' => 'getAmount',
'unit_amount' => 'getUnitAmount',
'notes' => 'getNotes'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['period'] = isset($data['period']) ? $data['period'] : null;
$this->container['amount'] = isset($data['amount']) ? $data['amount'] : null;
$this->container['unit_amount'] = isset($data['unit_amount']) ? $data['unit_amount'] : null;
$this->container['notes'] = isset($data['notes']) ? $data['notes'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
if (!is_null($this->container['notes']) && (mb_strlen($this->container['notes']) > 255)) {
$invalidProperties[] = "invalid value for 'notes', the character length must be smaller than or equal to 255.";
}
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets period
*
* @return string|null
*/
public function getPeriod()
{
return $this->container['period'];
}
public function getPeriodAsDate()
{
if ($this->getPeriod() != null) {
return StringUtil::convertStringToDate($this->getPeriod());
} else {
throw new \Exception('can not convert null string to date');
}
}
/**
* Sets period
*
* @param string|null $period Period the amount applies to (e.g. “2019-08”)
*
* @return $this
*/
public function setPeriod($period)
{
$this->container['period'] = $period;
return $this;
}
/**
* Sets period
*
* @param \DateTime |null $period Period the amount applies to (e.g. “2019-08”)
*
* @return $this
*/
public function setPeriodAsDate($period)
{
//CONVERT Date into MS DateFromat String
if (StringUtil::checkThisDate($period->format('Y-m-d')) )
{
$timeInMillis = strtotime($period->format('Y-m-d')." UTC") * 1000;
$period = "/Date(" . $timeInMillis. "+0000)/";
}
$this->container['period'] = $period;
return $this;
}
/**
* Gets amount
*
* @return double|null
*/
public function getAmount()
{
return $this->container['amount'];
}
/**
* Sets amount
*
* @param double|null $amount LineItem Quantity
*
* @return $this
*/
public function setAmount($amount)
{
$this->container['amount'] = $amount;
return $this;
}
/**
* Gets unit_amount
*
* @return double|null
*/
public function getUnitAmount()
{
return $this->container['unit_amount'];
}
/**
* Sets unit_amount
*
* @param double|null $unit_amount Budgeted amount
*
* @return $this
*/
public function setUnitAmount($unit_amount)
{
$this->container['unit_amount'] = $unit_amount;
return $this;
}
/**
* Gets notes
*
* @return string|null
*/
public function getNotes()
{
return $this->container['notes'];
}
/**
* Sets notes
*
* @param string|null $notes Any footnotes associated with this balance
*
* @return $this
*/
public function setNotes($notes)
{
if (!is_null($notes) && (mb_strlen($notes) > 255)) {
throw new \InvalidArgumentException('invalid length for $notes when calling BudgetBalance., must be smaller than or equal to 255.');
}
$this->container['notes'] = $notes;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
return json_encode(
AccountingObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
}