getMimeTypeFromObjectType() public static method

Determine the mime type given the object type.
public static getMimeTypeFromObjectType ( string $type ) : string
$type string The object type.
return string The mime type associated to the object type.
Exemplo n.º 1
0
 /**
  * Embed the Kolab content into a new MIME Part.
  *
  * @param resource $content The Kolab content.
  *
  * @return Horde_Mime_Part The MIME part that encapsules the Kolab content.
  */
 protected function createFreshKolabPart($content)
 {
     $part = new Horde_Mime_Part();
     $part->setCharset('utf-8');
     $part->setDisposition('inline');
     $part->setDispositionParameter('x-kolab-type', 'xml');
     $part->setName('kolab.xml');
     $part->setType(Horde_Kolab_Storage_Object_MimeType::getMimeTypeFromObjectType($this->getType()));
     $part->setContents($content, array('encoding' => 'quoted-printable'));
     return $part;
 }
Exemplo n.º 2
0
 /**
  * @expectedException Horde_Kolab_Storage_Data_Exception
  */
 public function testUndefinedMimeObjectType()
 {
     Horde_Kolab_Storage_Object_MimeType::getMimeTypeFromObjectType('UNDEFINED');
 }