Skip to content

Commit

Permalink
Merge pull request #767 from Healyhatman/AU-tracking-cat-settings
Browse files Browse the repository at this point in the history
Fix for Tracking Category in settings
  • Loading branch information
calcinai committed Sep 25, 2020
2 parents 7207cb1 + 1ac1ba8 commit 057502c
Show file tree
Hide file tree
Showing 3 changed files with 282 additions and 39 deletions.
134 changes: 134 additions & 0 deletions src/XeroPHP/Models/PayrollAU/Setting/EmployeeGroup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
<?php

namespace XeroPHP\Models\PayrollAU\Setting;

use XeroPHP\Remote;

class EmployeeGroup extends Remote\Model
{
/**
* Xero tracking category identifier. e.g c56b19ef-75bf-45e8-98a4-e699a96609f7.
*
* @property string TrackingCategoryID
*/

/**
* Name of tracking category.
*
* @property string TrackingCategoryName
*/

/**
* Get the resource uri of the class (Contacts) etc.
*
* @return string
*/
public static function getResourceURI()
{
return 'TrackingCategories';
}

/**
* Get the root node name. Just the unqualified classname.
*
* @return string
*/
public static function getRootNodeName()
{
return 'TrackingCategory';
}

/**
* Get the guid property.
*
* @return string
*/
public static function getGUIDProperty()
{
return 'TrackingCategoryID';
}

/**
* Get the stem of the API (core.xro) etc.
*
* @return string|null
*/
public static function getAPIStem()
{
return Remote\URL::API_PAYROLL;
}

/**
* Get the supported methods.
*/
public static function getSupportedMethods()
{
return [
];
}

/**
* Get the properties of the object. Indexed by constants
* [0] - Mandatory
* [1] - Type
* [2] - PHP type
* [3] - Is an Array
* [4] - Saves directly.
*
* @return array
*/
public static function getProperties()
{
return [
'TrackingCategoryID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'TrackingCategoryName' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
];
}

public static function isPageable()
{
return false;
}

/**
* @return string
*/
public function getTrackingCategoryID()
{
return $this->_data['TrackingCategoryID'];
}

/**
* @param string $value
*
* @return TrackingCategory
*/
public function setTrackingCategoryID($value)
{
$this->propertyUpdated('TrackingCategoryID', $value);
$this->_data['TrackingCategoryID'] = $value;

return $this;
}

/**
* @return string
*/
public function getTrackingCategoryName()
{
return $this->_data['TrackingCategoryName'];
}

/**
* @param string $value
*
* @return TrackingCategory
*/
public function setTrackingCategoryName($value)
{
$this->propertyUpdated('TrackingCategoryName', $value);
$this->_data['TrackingCategoryName'] = $value;

return $this;
}
}
134 changes: 134 additions & 0 deletions src/XeroPHP/Models/PayrollAU/Setting/TimesheetCategory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
<?php

namespace XeroPHP\Models\PayrollAU\Setting;

use XeroPHP\Remote;

class TimesheetCategory extends Remote\Model
{
/**
* Xero tracking category identifier. e.g c56b19ef-75bf-45e8-98a4-e699a96609f7.
*
* @property string TrackingCategoryID
*/

/**
* Name of tracking category.
*
* @property string TrackingCategoryName
*/

/**
* Get the resource uri of the class (Contacts) etc.
*
* @return string
*/
public static function getResourceURI()
{
return 'TrackingCategories';
}

/**
* Get the root node name. Just the unqualified classname.
*
* @return string
*/
public static function getRootNodeName()
{
return 'TrackingCategory';
}

/**
* Get the guid property.
*
* @return string
*/
public static function getGUIDProperty()
{
return 'TrackingCategoryID';
}

/**
* Get the stem of the API (core.xro) etc.
*
* @return string|null
*/
public static function getAPIStem()
{
return Remote\URL::API_PAYROLL;
}

/**
* Get the supported methods.
*/
public static function getSupportedMethods()
{
return [
];
}

/**
* Get the properties of the object. Indexed by constants
* [0] - Mandatory
* [1] - Type
* [2] - PHP type
* [3] - Is an Array
* [4] - Saves directly.
*
* @return array
*/
public static function getProperties()
{
return [
'TrackingCategoryID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'TrackingCategoryName' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
];
}

public static function isPageable()
{
return false;
}

/**
* @return string
*/
public function getTrackingCategoryID()
{
return $this->_data['TrackingCategoryID'];
}

/**
* @param string $value
*
* @return TrackingCategory
*/
public function setTrackingCategoryID($value)
{
$this->propertyUpdated('TrackingCategoryID', $value);
$this->_data['TrackingCategoryID'] = $value;

return $this;
}

/**
* @return string
*/
public function getTrackingCategoryName()
{
return $this->_data['TrackingCategoryName'];
}

/**
* @param string $value
*
* @return TrackingCategory
*/
public function setTrackingCategoryName($value)
{
$this->propertyUpdated('TrackingCategoryName', $value);
$this->_data['TrackingCategoryName'] = $value;

return $this;
}
}
53 changes: 14 additions & 39 deletions src/XeroPHP/Models/PayrollAU/Setting/TrackingCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
class TrackingCategory extends Remote\Model
{
/**
* Xero tracking category identifier. e.g c56b19ef-75bf-45e8-98a4-e699a96609f7.
* Employee Groups tracking category
*
* @property string TrackingCategoryID
* @property EmployeeGroup employeeGroups
*/

/**
* Name of tracking category.
* Timesheet Categories tracking category
*
* @property string TrackingCategoryName
* @property TimesheetCategory timesheetCategories
*/

/**
Expand All @@ -39,13 +39,12 @@ public static function getRootNodeName()
}

/**
* Get the guid property.
* Get the guid property. This model doesn't have one.
*
* @return string
*/
public static function getGUIDProperty()
{
return 'TrackingCategoryID';
public static function getGUIDProperty() {
return '';
}

/**
Expand All @@ -64,6 +63,7 @@ public static function getAPIStem()
public static function getSupportedMethods()
{
return [
Remote\Request::METHOD_GET
];
}

Expand All @@ -80,8 +80,8 @@ public static function getSupportedMethods()
public static function getProperties()
{
return [
'TrackingCategoryID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'TrackingCategoryName' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'EmployeeGroups' => [false, self::PROPERTY_TYPE_OBJECT, 'PayrollAU\\Setting\\EmployeeGroup', false, false],
'TimesheetCategories' => [false, self::PROPERTY_TYPE_OBJECT, 'PayrollAU\\Setting\\TimesheetCategory', false, false],
];
}

Expand All @@ -93,42 +93,17 @@ public static function isPageable()
/**
* @return string
*/
public function getTrackingCategoryID()
{
return $this->_data['TrackingCategoryID'];
}

/**
* @param string $value
*
* @return TrackingCategory
*/
public function setTrackingCategoryID($value)
public function getEmployeeGroups()
{
$this->propertyUpdated('TrackingCategoryID', $value);
$this->_data['TrackingCategoryID'] = $value;

return $this;
return $this->_data['EmployeeGroups'];
}

/**
* @return string
*/
public function getTrackingCategoryName()
public function getTimesheetCategories()
{
return $this->_data['TrackingCategoryName'];
return $this->_data['TimesheetCategories'];
}

/**
* @param string $value
*
* @return TrackingCategory
*/
public function setTrackingCategoryName($value)
{
$this->propertyUpdated('TrackingCategoryName', $value);
$this->_data['TrackingCategoryName'] = $value;

return $this;
}
}

0 comments on commit 057502c

Please sign in to comment.