getMimeType()); $type = TypeQuery::create()->findOneByMimes('%'.$file->getMimeType().'%'); var_dump($type); die; return count($type) ? $type->getId() : null; } public static function getTypesForType($add_auto = false) { $choices = $add_auto ? array('' => 'Automatic') : array(); $types = TypeQuery::create()->orderByLabel()->find(); foreach ($types as $k => $type) { $choices[$type->getId()] = $type->getLabel(); } return $choices; } }