public function __construct($data = NULL, $from_type = NULL)
{
// Get the CodeIgniter reference
$this->_CI =& get_instance();
// Load the inflector helper
$this->_CI->load->helper('inflector');
// If the provided data is already formatted we should probably convert it to an array
if ($from_type !== NULL) {
if (method_exists($this, '_from_' . $from_type)) {
$data = call_user_func([$this, '_from_' . $from_type], $data);
} else {
throw new Exception('Format class does not support conversion from "' . $from_type . '".');
}
}
// Set the member variable to the data passed
$this->_data = $data;
}