From 29b4c27b7ea56d5d12d6ff1e2eab2982b9f496cd Mon Sep 17 00:00:00 2001 From: Matt H Date: Thu, 11 Apr 2024 14:05:23 -0400 Subject: [PATCH] Add simplistic implementation of members->insert() --- SilMock/Google/Service/Directory.php | 3 ++ SilMock/Google/Service/Directory/Members.php | 37 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 SilMock/Google/Service/Directory/Members.php diff --git a/SilMock/Google/Service/Directory.php b/SilMock/Google/Service/Directory.php index 9e55aa7..666a932 100644 --- a/SilMock/Google/Service/Directory.php +++ b/SilMock/Google/Service/Directory.php @@ -3,6 +3,7 @@ namespace SilMock\Google\Service; use SilMock\Google\Service\Directory\Asps; +use SilMock\Google\Service\Directory\Members; use SilMock\Google\Service\Directory\Tokens; use SilMock\Google\Service\Directory\UsersResource; use SilMock\Google\Service\Directory\UsersAliasesResource; @@ -12,6 +13,7 @@ class Directory { public $asps; + public Members $members; public $tokens; public $users; public $users_aliases; @@ -28,6 +30,7 @@ class Directory public function __construct($client, $dbFile = null) { $this->asps = new Asps($dbFile); + $this->members = new Members($dbFile); $this->tokens = new Tokens($dbFile); $this->users = new UsersResource($dbFile); $this->users_aliases = new UsersAliasesResource($dbFile); diff --git a/SilMock/Google/Service/Directory/Members.php b/SilMock/Google/Service/Directory/Members.php new file mode 100644 index 0000000..97c246f --- /dev/null +++ b/SilMock/Google/Service/Directory/Members.php @@ -0,0 +1,37 @@ + $groupKey, + 'member' => get_object_vars($postBody), + ]); + $sqliteUtils = $this->getSqliteUtils(); + $sqliteUtils->recordData( + $this->dataType, + $this->dataClass, + $dataAsJson + ); + + $newMember = new Member(); + ObjectUtils::initialize($newMember, $postBody); + + return $newMember; + } +}