public function parseData($to, array $options = null)
{
$to = strtolower($to);
$types = array('csv', 'html', 'json', 'sql', 'xml', 'yaml');
if (!in_array($to, $types)) {
throw new Exception('That data type is not supported.');
}
$class = 'Pop\\Data\\Type\\' . ucfirst($to);
if ($to == 'sql') {
$this->file = $class::encode($this->data, $this->table, $this->idQuote);
} else {
if ($to == 'xml') {
$this->file = $class::encode($this->data, $this->table, $this->pma);
} else {
if ($to == 'html') {
$this->file = $class::encode($this->data, $options);
} else {
$this->file = $class::encode($this->data);
}
}
}
return $this->file;
}