src/Utility/FileUpload.php
public function getFiles(string $field, string $id) : ResultSetInterface
    {
        $query = $this->storageTable->find('all')
            ->where([self::FILE_STORAGE_FOREIGN_KEY => $id, 'model' => $this->table->getTable(), 'model_field' => $field])
            ->order($this->getOrderClause($field));

        $result = $query->all();
        foreach ($result as $entity) {
            $entity = $this->attachThumbnails($entity);
        }

        return $result;
    }
public function getFiles(string $field, string $id) : ResultSetInterface
    {
        $query = $this->storageTable->find('all')
            ->where([self::FILE_STORAGE_FOREIGN_KEY => $id, 'model' => $this->table->getTable(), 'model_field' => $field])
            ->order($this->getOrderClause($field));

        $result = $query->all();
        foreach ($result as $entity) {
            $entity = $this->attachThumbnails($entity);
        }

        return $result;
    }
public function getFiles ( string $ field , string $ id ) : ResultSetInterface { $ query = $ this -> storageTable -> find ( 'all' ) -> where ( [ self :: FILE_STORAGE_FOREIGN_KEY => $ id , 'model' => $ this -> table -> getTable ( ) , 'model_field' => $ field ] ) -> order ( $ this -> getOrderClause ( $ field ) ) ; $ result = $ query -> all ( ) ; foreach ( $ result as $ entity ) { $ entity = $ this -> attachThumbnails ( $ entity ) ; } return $ result ; }
Get files by foreign key record.

@param string $field Field name
@param string $id Foreign key value (UUID)
@return \Cake\Datasource\ResultSetInterface
Get files by foreign key record .