stat('priority'); } arsort($sortedClasses); foreach($sortedClasses as $className => $priority) { $formatter = singleton($className); if(in_array($extension, $formatter->supportedExtensions())) { return $formatter; } } } /** * Return an array of the extensions that this data formatter supports */ abstract function supportedExtensions(); /** * Convert a single data object to this format. Return a string. * @todo Add parameters for things like selecting output columns */ abstract function convertDataObject(DataObjectInterface $do); /** * Convert a data object set to this format. Return a string. * @todo Add parameters for things like selecting output columns */ abstract function convertDataObjectSet(DataObjectSet $set); }