Skip to content

Commit

Permalink
Add new method get() to get specific employee.
Browse files Browse the repository at this point in the history
  • Loading branch information
samaphp committed Jan 13, 2020
1 parent fa0d462 commit 6439744
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Employee.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,22 @@ public function all($options = []) {
return $res;
}

/**
* Get specific employee or current employee.
*/
public function get($options = []) {
$query = [];
// Add optional parameters if provided.
if (isset($options['id'])) {
$query['id'] = $options['id'];
}
if (isset($options['date'])) {
$query['date'] = $options['date'];
}

$url = 'employee';
$url = $this->buildUrl($url, $query);
$res = $this->makeGetCall($url);
return $res;
}
}

0 comments on commit 6439744

Please sign in to comment.