DataSift_Pylon::tags PHP Method

tags() public method

Analyze the tags in the data set
public tags ( string $id = false ) : array
$id string If ID is provided it will be set
return array Response from the tags endpoint
    public function tags($id = false)
    {
        if ($id) {
            $this->_id = $id;
        }
        if (strlen($this->_id) == 0) {
            throw new DataSift_Exception_InvalidData('Unable to get tags without an ID');
        }
        return $this->_user->get('pylon/tags', array('id' => $this->_id));
    }

Usage Example

Example #1
0
 public function testEmptyTags()
 {
     $response = array('response_code' => 200, 'data' => array(), 'rate_limit' => 200, 'rate_limit_remaining' => 150);
     DataSift_MockApiClient::setResponse($response);
     $pylon = new DataSift_Pylon($this->user);
     $id = "1a4268c9b924d2c48ed1946d6a7e6272";
     $tags = $pylon->tags($id);
     $this->assertCount(0, $tags, 'Amount of tags did not match');
 }