DataSift_Source::toArray PHP Method

toArray() public method

Converts this Source to an array suitable for transmission to the API
public toArray ( ) : array
return array
    public function toArray()
    {
        $data = array();
        $map = array('id' => 'getId', 'name' => 'getName', 'source_type' => 'getSourceType', 'status' => 'getStatus', 'parameters' => 'getParameters', 'auth' => 'getAuth', 'resources' => 'getResources', 'created_at' => 'getCreatedAt', 'validate' => 'getValidate');
        foreach ($map as $key => $getter) {
            $data[$key] = $this->{$getter}();
        }
        foreach (array('auth', 'resources', 'parameters') as $key) {
            if (isset($data[$key])) {
                $data[$key] = json_encode($data[$key]);
            }
        }
        return $data;
    }