Skip to content

Library for retrieving data from WhenIWork.com api

License

Notifications You must be signed in to change notification settings

mybuilder/when-i-work-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

When I Work library

This library support connection and retrieval of data from WhenIWork.com API. At least PHP 7.4 is required.

Docs: http://dev.wheniwork.com

require_once __DIR__ . '/vendor/autoload.php';

use MyBuilder\Library\WhenIWork\Repository\PayrollRepository;
use MyBuilder\Library\WhenIWork\Repository\UserRepository;
use MyBuilder\Library\WhenIWork\Service\WhenIWorkApi;

$serializer = JMS\Serializer\SerializerBuilder::create()->build();
$client = new GuzzleHttp\Client();
$whenIWorkApi = new WhenIWorkApi($client, 'your-developer-key', 'user-email', 'user-password');
$userRepository = new UserRepository($whenIWorkApi, $serializer);
$payrollRepository = new PayrollRepository($whenIWorkApi, $serializer);

List of all users:

$users = $userRepository->findAll();

List of all payroll periods:

$payrolls = $payrollRepository->findByPeriod();

Todos:

  • Add more models that are supported via WhenIWork API
  • Add more functions that are supported via WhenIWork API