sharingACL = $sharingACL; $this->shareRequest = $shareRequest; } /** * Creates requests for all the items on the request array of objects. * This array objects must follow this spec: * { * vault_id: The id of the target vault * guid: The guid of the target vault * key: The shared key cyphered with the target vault RSA public key * } * @param $target_item_id string The shared item ID * @param $target_item_guid string The shared item GUID * @param $request_array \stdClass[] * @param $permissions integer Must be created with a bitmask from options on the ShareRequest class */ public function createBulkRequests($target_item_id, $target_item_guid, $request_array, $permissions) { $created = (new \DateTime())->getTimestamp(); foreach ($request_array as $req){ $t = new ShareRequest(); $t->setItemId($target_item_id); $t->setItemGuid($target_item_guid); $t->setTargetVaultId($req->vault_id); $t->setTargetVaultGuid($req->guid); $t->setSharedKey($req->key); $t->setPermissions($permissions); $t->setCreated($created); var_dump($req); var_dump($t); $this->shareRequest->createRequest($t); } } }