mime)) { throw new NotImplementedException("Output types must have a mime type defined."); } $this->set_data($data); } /** * Set data to serialize * * @param mixed $data * @return mixed */ protected function set_data(&$data) { if ( ! is_null($data)) { $this->data = $data; } else { $data = $this->data; } return $data; } /** * Returns the mime type needed * for the current type * * @return string */ public function get_mime() { return $this->mime; } /** * Output the data as a string * * @return string */ public function __toString() { return $this->serialize($this->data); } } // End of Core/Abstracts/Type.php