You are here

protected static function ManagedFileBase::getLatestFid in Managed File 7

Get the file ID of latest uploaded file.

Return value

int File ID.

1 call to ManagedFileBase::getLatestFid()
ManagedFileTestCase::testWidgetIntegrity in tests/managed_file.test
Test integrity of the widget.

File

tests/managed_file_base.test, line 142
Managed File Base (Test).

Class

ManagedFileBase
Class ManagedFileBase.

Code

protected static function getLatestFid() {
  return db_select('file_usage', 'fu')
    ->fields('fu', [
    'fid',
  ])
    ->condition('module', static::MODULE)
    ->condition('type', 'menu')
    ->range(1, 1)
    ->execute()
    ->fetchField();
}