DataSift_Definition::get PHP Метод

get() публичный Метод

Returns the definition string.
public get ( ) : string
Результат string The definition.
    public function get()
    {
        if ($this->_csdl === false) {
            throw new DataSift_Exception_InvalidData('CSDL not available');
        }
        return $this->_csdl;
    }

Usage Example

Пример #1
0
 public function testGetDPUBreakdownOnInvalidDefinition()
 {
     $def = new DataSift_Definition($this->user, testdata('invalid_definition'));
     $this->assertEquals($def->get(), testdata('invalid_definition'));
     $response = array('response_code' => 400, 'data' => array('error' => 'The target interactin.content does not exist'), 'rate_limit' => 200, 'rate_limit_remaining' => 150);
     DataSift_MockApiClient::setResponse($response);
     try {
         $def->getDPUBreakdown();
         $this->fail('CompileFailed exception expected, but not thrown');
     } catch (DataSift_Exception_InvalidData $e) {
         // Check the error message
         $this->assertEquals($e->getMessage(), $response['data']['error']);
     } catch (DataSift_Exception_APIError $e) {
         $this->fail('APIError: ' . $e->getMessage() . ' (' . $e->getCode() . ')');
     } catch (Exception $e) {
         $this->fail('Unhandled exception: ' . $e->getMessage() . ' (' . $e->getCode() . ')');
     }
 }
All Usage Examples Of DataSift_Definition::get