mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-03 05:23:49 +00:00
[wip] first impl for getting authorization for admin
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\CalendarBundle\Synchro\Connector\MSGraph;
|
||||
|
||||
use DateTimeImmutable;
|
||||
use TheNetworg\OAuth2\Client\Provider\Azure;
|
||||
|
||||
class MSGraphClient
|
||||
{
|
||||
private Azure $provider;
|
||||
|
||||
private MSGraphTokenStorage $tokenStorage;
|
||||
|
||||
/**
|
||||
* @param mixed $calendar
|
||||
*
|
||||
* @return array as a json response
|
||||
*/
|
||||
public function listEventsForUserCalendar($calendar, DateTimeImmutable $startDate, DateTimeImmutable $endDate, ?int $start = null, ?int $limit = null): array
|
||||
{
|
||||
$from = $startDate->format(DateTimeImmutable::ATOM);
|
||||
$to = $endDate->format(DateTimeImmutable::ATOM);
|
||||
|
||||
$response = $this->provider->getObjects("{$calendar}/calendar/calendarView?startDateTime={$from}&endDateTime={$end}");
|
||||
|
||||
dump($response);
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user