@@ -18,14 +18,14 @@ |
||
| 18 | 18 | |
| 19 | 19 | $userId = 2565363; |
| 20 | 20 | $params = [ |
| 21 | - 'HIDE_ROUTED_ADDRESSES' => true, |
|
| 22 | - 'member_type' => 'SUB_ACCOUNT_DISPATCHER' |
|
| 21 | + 'HIDE_ROUTED_ADDRESSES' => true, |
|
| 22 | + 'member_type' => 'SUB_ACCOUNT_DISPATCHER' |
|
| 23 | 23 | ]; |
| 24 | 24 | |
| 25 | 25 | try { |
| 26 | - $tm = new TeamManagement(); |
|
| 27 | - $res = $tm->update($userId, $params); |
|
| 28 | - print_r($res); |
|
| 26 | + $tm = new TeamManagement(); |
|
| 27 | + $res = $tm->update($userId, $params); |
|
| 28 | + print_r($res); |
|
| 29 | 29 | } catch (ApiError $e) { |
| 30 | - echo $e->getMessage() . PHP_EOL; |
|
| 30 | + echo $e->getMessage() . PHP_EOL; |
|
| 31 | 31 | } |
@@ -27,5 +27,5 @@ |
||
| 27 | 27 | $res = $tm->update($userId, $params); |
| 28 | 28 | print_r($res); |
| 29 | 29 | } catch (ApiError $e) { |
| 30 | - echo $e->getMessage() . PHP_EOL; |
|
| 30 | + echo $e->getMessage().PHP_EOL; |
|
| 31 | 31 | } |
@@ -19,51 +19,51 @@ |
||
| 19 | 19 | Route4Me::setApiKey(Constants::API_KEY); |
| 20 | 20 | |
| 21 | 21 | try { |
| 22 | - // get OWNER_MEMBER_ID |
|
| 23 | - $owner_member_id = null; |
|
| 24 | - $member = new Member(); |
|
| 25 | - $res_members = $member->getUsers(); |
|
| 22 | + // get OWNER_MEMBER_ID |
|
| 23 | + $owner_member_id = null; |
|
| 24 | + $member = new Member(); |
|
| 25 | + $res_members = $member->getUsers(); |
|
| 26 | 26 | |
| 27 | - if (is_array($res_members) && isset($res_members['results'])) { |
|
| 28 | - foreach ($res_members['results'] as $key => $value) { |
|
| 29 | - if ($value['OWNER_MEMBER_ID'] == 0) { |
|
| 30 | - $owner_member_id = $value['member_id']; |
|
| 31 | - break; |
|
| 32 | - } |
|
| 33 | - } |
|
| 34 | - } |
|
| 27 | + if (is_array($res_members) && isset($res_members['results'])) { |
|
| 28 | + foreach ($res_members['results'] as $key => $value) { |
|
| 29 | + if ($value['OWNER_MEMBER_ID'] == 0) { |
|
| 30 | + $owner_member_id = $value['member_id']; |
|
| 31 | + break; |
|
| 32 | + } |
|
| 33 | + } |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - if (!$owner_member_id) { |
|
| 37 | - throw new Exception("Cannot find OWNER_MEMBER_ID."); |
|
| 38 | - } |
|
| 36 | + if (!$owner_member_id) { |
|
| 37 | + throw new Exception("Cannot find OWNER_MEMBER_ID."); |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - // insert new sub-users |
|
| 41 | - $params = [ |
|
| 42 | - [ |
|
| 43 | - 'new_password' => '12345&Qwerty', |
|
| 44 | - 'member_first_name' => 'Tusha I', |
|
| 45 | - 'member_last_name' => 'Pupkindzes', |
|
| 46 | - 'member_email' => '[email protected]', |
|
| 47 | - 'member_type' => 'SUB_ACCOUNT_DRIVER', |
|
| 48 | - 'OWNER_MEMBER_ID' => $owner_member_id |
|
| 49 | - ], [ |
|
| 50 | - 'new_password' => '12345&Qwerty', |
|
| 51 | - 'member_first_name' => 'Tusha II', |
|
| 52 | - 'member_last_name' => 'Pupkindzes', |
|
| 53 | - 'member_email' => '[email protected]', |
|
| 54 | - 'member_type' => 'SUB_ACCOUNT_DRIVER', |
|
| 55 | - 'OWNER_MEMBER_ID' => $owner_member_id |
|
| 56 | - ] |
|
| 57 | - ]; |
|
| 40 | + // insert new sub-users |
|
| 41 | + $params = [ |
|
| 42 | + [ |
|
| 43 | + 'new_password' => '12345&Qwerty', |
|
| 44 | + 'member_first_name' => 'Tusha I', |
|
| 45 | + 'member_last_name' => 'Pupkindzes', |
|
| 46 | + 'member_email' => '[email protected]', |
|
| 47 | + 'member_type' => 'SUB_ACCOUNT_DRIVER', |
|
| 48 | + 'OWNER_MEMBER_ID' => $owner_member_id |
|
| 49 | + ], [ |
|
| 50 | + 'new_password' => '12345&Qwerty', |
|
| 51 | + 'member_first_name' => 'Tusha II', |
|
| 52 | + 'member_last_name' => 'Pupkindzes', |
|
| 53 | + 'member_email' => '[email protected]', |
|
| 54 | + 'member_type' => 'SUB_ACCOUNT_DRIVER', |
|
| 55 | + 'OWNER_MEMBER_ID' => $owner_member_id |
|
| 56 | + ] |
|
| 57 | + ]; |
|
| 58 | 58 | |
| 59 | - $options = [ |
|
| 60 | - 'conflicts' => 'overwrite' |
|
| 61 | - ]; |
|
| 59 | + $options = [ |
|
| 60 | + 'conflicts' => 'overwrite' |
|
| 61 | + ]; |
|
| 62 | 62 | |
| 63 | - $tm = new TeamManagement(); |
|
| 64 | - $res = $tm->bulkInsert($params, $options); |
|
| 65 | - //print_r($res); |
|
| 66 | - echo "Insert two sub-users." . PHP_EOL; |
|
| 63 | + $tm = new TeamManagement(); |
|
| 64 | + $res = $tm->bulkInsert($params, $options); |
|
| 65 | + //print_r($res); |
|
| 66 | + echo "Insert two sub-users." . PHP_EOL; |
|
| 67 | 67 | } catch (Exception | ApiError $e) { |
| 68 | - echo $e->getMessage() . PHP_EOL; |
|
| 68 | + echo $e->getMessage() . PHP_EOL; |
|
| 69 | 69 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | if (is_array($res_members) && isset($res_members['results'])) { |
| 28 | 28 | foreach ($res_members['results'] as $key => $value) { |
| 29 | - if ($value['OWNER_MEMBER_ID'] == 0) { |
|
| 29 | + if ($value['OWNER_MEMBER_ID']==0) { |
|
| 30 | 30 | $owner_member_id = $value['member_id']; |
| 31 | 31 | break; |
| 32 | 32 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $tm = new TeamManagement(); |
| 64 | 64 | $res = $tm->bulkInsert($params, $options); |
| 65 | 65 | //print_r($res); |
| 66 | - echo "Insert two sub-users." . PHP_EOL; |
|
| 66 | + echo "Insert two sub-users.".PHP_EOL; |
|
| 67 | 67 | } catch (Exception | ApiError $e) { |
| 68 | - echo $e->getMessage() . PHP_EOL; |
|
| 68 | + echo $e->getMessage().PHP_EOL; |
|
| 69 | 69 | } |
@@ -18,9 +18,9 @@ |
||
| 18 | 18 | $userId = 2567512; |
| 19 | 19 | |
| 20 | 20 | try { |
| 21 | - $tm = new TeamManagement(); |
|
| 22 | - $res = $tm->delete($userId); |
|
| 23 | - print_r($res); |
|
| 21 | + $tm = new TeamManagement(); |
|
| 22 | + $res = $tm->delete($userId); |
|
| 23 | + print_r($res); |
|
| 24 | 24 | } catch (ApiError $e) { |
| 25 | - echo 'Cannot delete user with ID: ' . $userId . PHP_EOL; |
|
| 25 | + echo 'Cannot delete user with ID: ' . $userId . PHP_EOL; |
|
| 26 | 26 | } |
@@ -22,5 +22,5 @@ |
||
| 22 | 22 | $res = $tm->delete($userId); |
| 23 | 23 | print_r($res); |
| 24 | 24 | } catch (ApiError $e) { |
| 25 | - echo 'Cannot delete user with ID: ' . $userId . PHP_EOL; |
|
| 25 | + echo 'Cannot delete user with ID: '.$userId.PHP_EOL; |
|
| 26 | 26 | } |