mybuilder/when-i-work-api

Library that support connections and retrieve data from WhenIWork.com API

1.0.1 2022-09-28 12:46 UTC

This package is auto-updated.

Last update: 2024-11-28 17:16:40 UTC


README

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