DataSift_Historic::stop PHP Method

stop() public method

Stop this historic query.
public stop ( ) : void
return void
    public function stop()
    {
        if ($this->_deleted) {
            throw new DataSift_Exception_InvalidData('Cannot stop a deleted Historic.');
        }
        if ($this->_playback_id === false || strlen($this->_playback_id) == 0) {
            throw new DataSift_Exception_InvalidData('Cannot stop a historic query that hasn\'t been prepared.');
        }
        try {
            $res = $this->_user->post('historics/stop', array('id' => $this->_playback_id));
        } catch (DataSift_Exception_APIError $e) {
            switch ($e->getCode()) {
                case 400:
                    // Missing or invalid parameters
                    throw new DataSift_Exception_InvalidData($e->getMessage());
                case 404:
                    // Historic query not found
                    throw new DataSift_Exception_InvalidData($e->getMessage());
                default:
                    throw new DataSift_Exception_APIError('Unexpected APIError code: ' . $e->getCode() . ' [' . $e->getMessage() . ']');
            }
        }
    }