Gets mimetype

@param string $object
@return string
484853
private function getMimeType($object, $file = null)
    {
        if (!is_null($file)) {
            $type = MimeTypes::getMimetype($file);
            if (!is_null($type)) {
                return $type;
            }
        }

        $type = MimeTypes::getMimetype($object);
        if (!is_null($type)) {
            return $type;
        }

        return self::DEFAULT_CONTENT_TYPE;
    }
990634
public function getDataTransferObjectName($object) {
		$objectName = TypeHandling::getTypeForValue($object);

		if (!array_key_exists($objectName, $this->classMappingConfiguration)) {
			foreach (array_reverse($this->classNameToDtoClassNameReplaceFragments, TRUE) as $dtoClassNameFragment => $classNameFragment) {
				$dtoClassName = str_replace($classNameFragment, $dtoClassNameFragment, $objectName);
				if (class_exists($dtoClassName)) {
					$this->classMappingConfiguration[$objectName] = $dtoClassName;
					break;
				}
			}
		}

		if (!isset($this->classMappingConfiguration[$objectName])) {
			throw new InvalidTargetException(sprintf('There is no DTO class name for "%s" objects.', $objectName), 1407499486);
		}

		return $this->classMappingConfiguration[$objectName];
	}
959262
protected function generateToken ($object)
	{
		$token = get_class ($object);

		if ($pos = strrpos ($token, "\\")) {
			$token = strtolower (substr ($token, $pos + 1));
		}

		if (isset ($this->tokens[$token]))
		{
			$i = 1;
			$tmp = $token . $i;
			while (isset ($this->tokens[$tmp]))
			{
				$i ++;
			}
			$token = $tmp;
		}

		$this->tokens[$token] = true;
		return $token;
	}
1151641
public static function getDownloadUrl($object)
    {
        $urlParts  = parse_url($object->apiURL);
        $pathParts = pathinfo($urlParts['path']);
        return $urlParts['scheme'].'://'.$urlParts['host'] .( array_key_exists('port',$urlParts) ? ':'.$urlParts['port'] : '') .$pathParts['dirname'].'/'.$pathParts['filename'].'/content';
    }
877831
protected function hydrateObjectForm($object)
    {
        $data = array(
            'id' => $object->getId(),
            'locale' => $object->getLocale(),
            'visible' => $object->getVisible() ? true : false,
            'title' => $object->getTitle(),
            'chapo' => $object->getChapo(),
            'description' => $object->getDescription(),
            'postscriptum' => $object->getPostscriptum(),
            'isocode' => $object->getIsocode(),
            'isoalpha2' => $object->getIsoalpha2(),
            'isoalpha3' => $object->getIsoalpha3(),
            'has_states' => $object->getHasStates() ? true : false,
            'need_zip_code' => $object->getNeedZipCode() ? true : false,
            'zip_code_format' => $object->getZipCodeFormat(),
        );

        return $this->createForm(AdminForm::COUNTRY_MODIFICATION, 'form', $data);
    }
392987
protected function createObject($object)
    {
        $type = new ObjectType(['class'=>get_class($object)]);

        foreach (get_object_vars($object) as $property=>$value) {
            $type[$property] = $this->toType($value);
        }

        return $type;
    }
1307522
public static function getClass($object)
    {
        $inflector                       = self::$classNameInflector
            ?? self::$classNameInflector = (new Configuration())->getClassNameInflector();

        return $inflector->getUserClassName(get_class($object));
    }
927234
protected function getIdentifierFromObject($object)
    {
        $class = get_class($object);
        $meta = $this->entityMetadataFactory->getMetadataFor($class);
        $values = $meta->getIdentifierValues($object);

        $values = array_map(
            function ($value) {
                if (is_object($value)) {
                    return $this->getIdentifierFromObject($value);
                }

                return $value;
            },
            $values
        );

        return $values;
    }
93551
protected function getPrefix($object)
    {
        $id = 'user';

        if (method_exists($object, 'getOrganization')) {
            $org = $object->getOrganization();

            if ($org instanceof OrganizationInterface) {
                $id = (string) $org->getId();
            }
        }

        return $id.'__';
    }
818374
public function formatter($object)
    {
        $interfaces = class_implements($object);

        foreach ($interfaces as $interface) {
            $class = $this->getClassName($interface);

            if ($object instanceof Collection) {
                if ($object->first() instanceof Coupon) {
                    return $this->formatters['Coupon'];
                }
            }

            if (isset($this->formatters[$class])) {
                return $this->formatters[$class];
            }
        }

        $class = $this->getClassName(get_class($object));

        return $this->formatters[$class];
    }
82213
private function serializeBodyObject($object): string
    {
        try {
            return $this->serializer->serialize($object, 'atol_client', $this->getSerializeBodyObjectContext());
        } catch (\RuntimeException $exception) {
            throw ParseException::becauseOfRuntimeException($exception, ParseException::REQUEST);
        }
    }
58740
protected function _getModelName($object)
    {
        $obj = explode('-', preg_replace('/[^\p{L}\p{N}-_]/u', '', $object));
        foreach ($obj as $k => $v) {
            $obj[$k] = ucfirst($v);
        }
        $class = $obj[0] . '\\Model\\' . $obj[0];
        unset($obj[0]);
        return rtrim($class . implode('', $obj)) . 'Api';
    }
1147916
public static function getMimeType($extension)
    {
        if (!isset(self::$mimeTypes[$extension])) {
            return null;
        }

        return self::$mimeTypes[$extension];
    }
652016
public function getMappedObjectType($object): ?string
    {
        foreach ($this->typesMapping as $type => $typeClass) {
            if (is_a($object, $typeClass)) {
                return $type;
            }
        }

        return null;
    }
628715
function getMimeType(){
		static $mime_types = array(
			"jpg" => "image/jpeg",
			"png" => "image/png",
			"tiff" => "image/tiff",
			"gif" => "image/gif",
			"svg" => "image/svg+xml",
			"bmp" => "image/bmp",

			"doc" => "application/msword",
			"xls" => "application/vnd.ms-excel",
			"ppt" => "application/vnd.ms-powerpoint",
			"xlsx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",

			"docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document",

			"odt" => "application/vnd.oasis.opendocument.text",
			"ods" => "application/vnd.oasis.opendocument.spreadsheet",

			"eps" => "application/postscript",
			"ai" => "application/postscript",
			"pdf" => "application/pdf",

			"zip" => "application/zip",

			"mp3" => "audio/mpeg",
		);
		$suffix = strtolower($this->getSuffix());
		if(isset($mime_types[$suffix])){
			return $mime_types[$suffix];
		}
	}
19584
public function toArrayFunction($object)
    {
        if (is_string($object)) {
            return json_decode($object, true);
        }

        return json_decode(json_encode($object), true);
    }
692879
protected function getClassName($object)
    {
        require_once 'Zend/Amf/Parse/TypeLoader.php';
        //Check to see if the object is a typed object and we need to change
        $className = '';
        switch (true) {
            // the return class mapped name back to actionscript class name.
            case Zend_Amf_Parse_TypeLoader::getMappedClassName(get_class($object)):
                $className = Zend_Amf_Parse_TypeLoader::getMappedClassName(get_class($object));
                break;
                // Check to see if the user has defined an explicit Action Script type.
            case isset($object->_explicitType):
                $className = $object->_explicitType;
                break;
                // Check if user has defined a method for accessing the Action Script type
            case method_exists($object, 'getASClassName'):
                $className = $object->getASClassName();
                break;
                // No return class name is set make it a generic object
            case ($object instanceof stdClass):
                $className = '';
                break;
        // By default, use object's class name
            default:
        $className = get_class($object);
                break;
        }
        if(!$className == '') {
            return $className;
        } else {
            return false;
        }
    }