public function getProfileFromWatson()
    {
        // We have the request in cache and cache is on.
        if ($this->cacheIsOn() && $this->cache->has($this->getContainer()->getCacheKey())) {
            // Return results from cache.
            return $this->cache->get($this->getContainer()->getCacheKey());
        }

        // Send Request to Watson.
        $response = $this->sendRequest();

        // Decode and map onto Object.
        /** @var Profile $profile */
        $profile = $this->jsonMapper->map(json_decode($response->getBody()->getContents()), new Profile);

        // Cache results if cache is on.
        if ($this->cacheIsOn()) {
            $this->cache->put($this->getContainer()->getCacheKey(), $profile, $this->cacheLifetime());
        }

        // Return profile.
        return $profile;
    }
public function getProfileFromWatson()
    {
        // We have the request in cache and cache is on.
        if ($this->cacheIsOn() && $this->cache->has($this->getContainer()->getCacheKey())) {
            // Return results from cache.
            return $this->cache->get($this->getContainer()->getCacheKey());
        }

        // Send Request to Watson.
        $response = $this->sendRequest();

        // Decode and map onto Object.
        /** @var Profile $profile */
        $profile = $this->jsonMapper->map(json_decode($response->getBody()->getContents()), new Profile);

        // Cache results if cache is on.
        if ($this->cacheIsOn()) {
            $this->cache->put($this->getContainer()->getCacheKey(), $profile, $this->cacheLifetime());
        }

        // Return profile.
        return $profile;
    }
public function getProfileFromWatson ( ) { // We have the request in cache and cache is on. if ( $ this -> cacheIsOn ( ) && $ this -> cache -> has ( $ this -> getContainer ( ) -> getCacheKey ( ) ) ) { // Return results from cache. return $ this -> cache -> get ( $ this -> getContainer ( ) -> getCacheKey ( ) ) ; } // Send Request to Watson. $ response = $ this -> sendRequest ( ) ; // Decode and map onto Object. /** @var Profile $profile */ $ profile = $ this -> jsonMapper -> map ( json_decode ( $ response -> getBody ( ) -> getContents ( ) ) , new Profile ) ; // Cache results if cache is on. if ( $ this -> cacheIsOn ( ) ) { $ this -> cache -> put ( $ this -> getContainer ( ) -> getCacheKey ( ) , $ profile , $ this -> cacheLifetime ( ) ) ; } // Return profile. return $ profile ; }
Get Full Insights From Watson API.

@throws \FindBrok\WatsonBridge\Exceptions\WatsonBridgeException

@return Profile
Get Full Insights From Watson API .