Returns the filename of the template or false if no file found.

@param  object      $object
@param  string      $context
@return array<string,string>|null An array with 2 keys: "filename" and "type", or null if nothing found
960602
private function getTemplateFileName($object, ?string $context = null): ?array
    {
        $fullClassName = get_class($object);

        // Optimisation: let's see if we already performed the file_exists checks.
        $cacheKey = md5("FileBasedRenderer_".$this->directory.'/'.$fullClassName.'/'.$context);

        $cachedValue = $this->cacheService->get($cacheKey);
        if ($cachedValue !== null && !$this->debugMode) {
            return $cachedValue;
        }

        $fileName = $this->findFile($fullClassName, $context);
        $parentClass = $fullClassName;
        // If no file is found, let's go through the parents of the object.
        while (true) {
            if ($fileName != false) {
                break;
            }
            $parentClass = get_parent_class($parentClass);
            if ($parentClass == false) {
                break;
            }
            $fileName = $this->findFile($parentClass, $context);
        }

        // Still no objects? Let's browse the interfaces.
        if ($fileName == false) {
            $interfaces = class_implements($fullClassName);
            foreach ($interfaces as $interface) {
                $fileName = $this->findFile($interface, $context);
                if ($fileName != false) {
                    break;
                }
            }
        }

        $this->cacheService->set($cacheKey, $fileName);

        return $fileName;
    }
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];
	}
417058
protected function getObjectString($object)/*# : string */
    {
        // exception found
        if ($object instanceof \Exception) {
            return 'EXCEPTION: ' . $object->getMessage();

        // toString() found
        } elseif (method_exists($object, '__toString')) {
            return (string) $object;

        // other type object
        } else {
            return 'OBJECT: ' . get_class($object);
        }
    }
1195433
protected function name($name = null)
    {
        $filename = is_null($name) ? $this->filename() : $name;

        $hash = Hash::make($filename);

        $name = $hash;
        //
        $this->templateFile = $name;
        //
        return $name;
    }
264140
protected static function createGcsFilename($bucket, $object = null) {
    if (!isset($object)) {
      $object = "";
    }

    // Strip leading "/" for $object.
    if (StringUtil::startsWith($object, "/")) {
      $object = substr($object, 1);
    }

    return CloudStorageTools::getFilename($bucket, $object);
  }
891672
protected function convertObjectInfo($object)
    {
        $identity = $object->identity();
        $objectInfo = $object->info();
        $objectName = $identity['object'];

        // determine whether it's a file or a directory
        $type = 'file';
        $objectNameLength = strlen($objectName);
        if (strpos($objectName, '/', $objectNameLength - 1)) {
            $type = 'dir';
        }

        $normalizedObjectInfo = [
            'type' => $type,
            'path' => $objectName,
        ];

        // timestamp
        $datetime = \DateTime::createFromFormat('Y-m-d\TH:i:s+', $objectInfo['updated']);
        $normalizedObjectInfo['timestamp'] = $datetime->getTimestamp();

        // size when file
        if ($type === 'file') {
            $normalizedObjectInfo['size'] = $objectInfo['size'];
            $normalizedObjectInfo['mimetype'] = isset($objectInfo['contentType']) ? $objectInfo['contentType'] : null;
        }

        return $normalizedObjectInfo;
    }
1205242
public function getChildTemplates(string $context): array
    {
        Splash::log()->Deb('Loading Standalone Connector Templates for '.$context);
        $result = array();
        //====================================================================//
        // Safety Check
        if (!in_array($context, array('New', 'Offline', 'Connected'), true)) {
            return $result;
        }
        //====================================================================//
        // Load templates for All Objects
        foreach ($this->getAvailableObjects() as $objectType) {
            $objectService = $this->getObjectService($objectType);
            if (method_exists($objectService, 'get'.$context.'Template')) {
                $result[] = $objectService->{'get'.$context.'Template'}();
            }
        }
        //====================================================================//
        // Return Results
        return $result;
    }
646913
public function normalize($object, $format = null, array $context = [])
    {
        $resourceClass = $this->resourceClassResolver->getResourceClass(
            $object,
            $context['resource_class'] ?? null,
            true
        );
        $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
        $data = $this->addJsonLdContext($this->contextBuilder, $resourceClass, $context);

        $rawData = parent::normalize($object, $format, $context);
        if (!\is_array($rawData)) {
            return $rawData;
        }

        $data['@id'] = $this->iriConverter->getIriFromItem($object);
        $data['@type'] = $resourceMetadata->getIri() ?: $resourceMetadata->getShortName();

        return $data + $rawData;
    }
401169
public static function urlEncodeShortName($object) {
        $classname = static::getShortName($object);
        $explode   = preg_replace("/([a-z]{1})([A-Z]{1})/", "$1-$2", $classname);
        return strtolower($explode);
    }
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';
    }
798127
private function getFieldValue($object, Field $field)
    {
        if (is_array($object)) {
            $path = '[' . $field->getName() . ']';
        } else {
            $path = $field->getName();
        }

        return $this->accessor->getValue($object, $path);
    }
332563
public static function getTable($object)
    {
        $tableAnnotation = static::getAnnotation($object, Table::class);
        if(null !== $tableAnnotation)
        {
            return $tableAnnotation->name;
        }
        else
        {
            return null;
        }
    }
1194577
private function getMimeType(\SplFileInfo $object)
    {
        if ($object instanceof File) {
            return $object->getMimeType();
        }

        if ($this->mimeTypeGuesser instanceof DeprecatedMimeTypeGuesserInterface && $mimeType = $this->mimeTypeGuesser->guess($object->getPathname())) {
            return $mimeType;
        } elseif ($this->mimeTypeGuesser && $mimeType = $this->mimeTypeGuesser->guessMimeType($object->getPathname())) {
            return $mimeType;
        }

        return 'application/octet-stream';
    }
461533
public static function getRedisEntity($object)
    {
        $annotation = static::getAnnotation($object, RedisEntity::class);
        if(null !== $annotation)
        {
            return $annotation;
        }
        else
        {
            return null;
        }
    }
591116
public function normalize($object, $format = null, array $context = array())
    {
        $context['depth'] = isset($context['depth']) ? $context['depth']+1 : 0;

        if (!isset($context['@references'])) {
            $references = array();
            $context['@references'] = &$references;
        }

        if (!isset($context['cache_key'])) {
            $context['cache_key'] = md5(serialize($context));
        }

        $class = get_class($object);

        /* @var ClassMetadata $meta */
        $context['entityMeta'] = $this->entityMetadataFactory->getMetadataFor($class);

        $data = array();
        $attributes = $this->getAttributes($object, $format, $context);
        foreach ($attributes as $attribute) {
            $value = $this->getAttributeValue($object, $attribute, $format, $context);

            $data[$attribute] = $this->normalizeProperty($value, $attribute, $format, $context);
        }

        $hint = $this->getHintFromObject($object);


        if ($context['depth'] === 0 and !empty($context['@references'])) {
            $ids = $this->getIdentifierFromObject($object);
            $id = $this->getIdentifiersAsString($ids);
            $objectId = current($hint).'#'.$id;

            unset($context['@references'][$objectId]);

            ksort($context['@references']);
            $data['@references'] = array_filter($context['@references']);
        }

        return array_merge($hint, $data);
    }
36586
protected function contextObjectName(): string {
		$objectName = $this->getClassName($this->model());
		
		return $this->lcFirstName($objectName);
	}
1214617
protected function transformOutput($object, array $context = [])
    {
        $outputClass = $this->getOutputClass($this->getObjectClass($object), $context);
        if (null !== $outputClass && null !== $dataTransformer = $this->getDataTransformer($object, $outputClass, $context)) {
            return $dataTransformer->transform($object, $outputClass, $context);
        }

        return $object;
    }