src/Twig/FileExtension.php
public function getFileData($file, array $data = [], array $jsonSerializeOptions = []): array
    {
        if (null === ($fileObj = $this->container->get('huh.utils.file')->getFileFromUuid($file))) {
            return [];
        }

        $fileData = $this->container->get('huh.utils.class')->jsonSerialize($fileObj, $data, array_merge_recursive($jsonSerializeOptions, ['ignoreMethods' => true]));

        foreach (static::FILE_OBJECT_PROPERTIES as $property) {
            $fileData[$property] = $fileObj->{$property};
        }

        return $fileData;
    }
public function getFileData($file, array $data = [], array $jsonSerializeOptions = []): array
    {
        if (null === ($fileObj = $this->container->get('huh.utils.file')->getFileFromUuid($file))) {
            return [];
        }

        $fileData = $this->container->get('huh.utils.class')->jsonSerialize($fileObj, $data, array_merge_recursive($jsonSerializeOptions, ['ignoreMethods' => true]));

        foreach (static::FILE_OBJECT_PROPERTIES as $property) {
            $fileData[$property] = $fileObj->{$property};
        }

        return $fileData;
    }
public function getFileData ( $ file , array $ data = [ ] , array $ jsonSerializeOptions = [ ] ) : array { if ( null === ( $ fileObj = $ this -> container -> get ( 'huh.utils.file' ) -> getFileFromUuid ( $ file ) ) ) { return [ ] ; } $ fileData = $ this -> container -> get ( 'huh.utils.class' ) -> jsonSerialize ( $ fileObj , $ data , array_merge_recursive ( $ jsonSerializeOptions , [ 'ignoreMethods' => true ] ) ) ; foreach ( static :: FILE_OBJECT_PROPERTIES as $ property ) { $ fileData [ $ property ] = $ fileObj -> { $ property } ; } return $ fileData ; }
Get file data based on given uuid.

@param mixed $file                 File uuid
@param array $data                 Add file data here
@param array $jsonSerializeOptions Options for the object to array transformation

@throws \ReflectionException

@return array File data
Get file data based on given uuid .