common/repositories/HostRepository.php
/**
    * Update Content Provider Status By Service Api Call
    * @param ContentProvider $id,Service $url string,Host $status string
    * @return Http Guzzle response GetBody
    */
Update Content Provider Status By Service Api Call
@param ContentProvider $id,Service $url string,Host $status string
@return Http Guzzle response GetBody
Update Content Provider Status By Service Api Call @param ContentProvider $id Service $url string Host $status string @return Http Guzzle response GetBody
public function updateContentProviderByApiCall($id,$url,$status){
        $authManager = \Yii::$app->authManager;
        $admin = User::find()->where(['in', 'id', $authManager->getUserIdsByRole('admin')])->one();
        if ($admin == null) {
            throw new Exception('No user with \'admin\' role found.');
        }
        $client = new \GuzzleHttp\Client();
        $res = $client->put($url.'/content-provider/update/'.$id,[
            'body' => ['status' => $status],
            'headers' => ['Authorization' => 'Bearer '.$admin->access_token],
        ]);
        return $res->getBody();
    }
public function updateContentProviderByApiCall ( $ id , $ url , $ status ) { $ authManager = \ Yii :: $ app -> authManager ; $ admin = User :: find ( ) -> where ( [ 'in' , 'id' , $ authManager -> getUserIdsByRole ( 'admin' ) ] ) -> one ( ) ; if ( $ admin == null ) { throw new Exception ( 'No user with \'admin\' role found.' ) ; } $ client = new \ GuzzleHttp \ Client ( ) ; $ res = $ client -> put ( $ url . '/content-provider/update/' . $ id , [ 'body' => [ 'status' => $ status ] , 'headers' => [ 'Authorization' => 'Bearer ' . $ admin -> access_token ] , ] ) ; return $ res -> getBody ( ) ; }
Update Content Provider Status By Service Api Call
 @param ContentProvider $id,Service $url string,Host $status string
 @return Http Guzzle response GetBody
Update Content Provider Status By Service Api Call @param ContentProvider $id Service $url string Host $status string @return Http Guzzle response GetBody