FileStorage.php
Same filename in this branch
Same filename in other branches
- 9 core/modules/file/src/FileStorage.php
- 9 core/lib/Drupal/Core/Config/FileStorage.php
- 9 core/lib/Drupal/Component/PhpStorage/FileStorage.php
- 8.9.x core/modules/file/src/FileStorage.php
- 8.9.x core/lib/Drupal/Core/Config/FileStorage.php
- 8.9.x core/lib/Drupal/Component/PhpStorage/FileStorage.php
- 10 core/modules/file/src/FileStorage.php
- 10 core/lib/Drupal/Core/Config/FileStorage.php
- 10 core/lib/Drupal/Component/PhpStorage/FileStorage.php
Namespace
Drupal\fileFile
-
core/
modules/ file/ src/ FileStorage.php
View source
<?php
namespace Drupal\file;
use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
/**
* File storage for files.
*/
class FileStorage extends SqlContentEntityStorage implements FileStorageInterface {
/**
* {@inheritdoc}
*/
public function spaceUsed($uid = NULL, $status = FileInterface::STATUS_PERMANENT) {
$query = $this->database
->select($this->entityType
->getBaseTable(), 'f')
->condition('f.status', $status);
$query->addExpression('SUM([f].[filesize])', 'filesize');
if (isset($uid)) {
$query->condition('f.uid', $uid);
}
return $query->execute()
->fetchField();
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
FileStorage | File storage for files. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.