class FileSizeLimitConstraint

Same name in other branches
  1. 10 core/modules/file/src/Plugin/Validation/Constraint/FileSizeLimitConstraint.php \Drupal\file\Plugin\Validation\Constraint\FileSizeLimitConstraint

File size max constraint.

Hierarchy

  • class \Drupal\file\Plugin\Validation\Constraint\FileSizeLimitConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of FileSizeLimitConstraint

File

core/modules/file/src/Plugin/Validation/Constraint/FileSizeLimitConstraint.php, line 12

Namespace

Drupal\file\Plugin\Validation\Constraint
View source
class FileSizeLimitConstraint extends SymfonyConstraint {
    
    /**
     * The message for when file size limit is exceeded.
     *
     * @var string
     */
    public string $maxFileSizeMessage = 'The file is %filesize exceeding the maximum file size of %maxsize.';
    
    /**
     * The message for when disk quota is exceeded.
     *
     * @var string
     */
    public string $diskQuotaMessage = 'The file is %filesize which would exceed your disk quota of %quota.';
    
    /**
     * The file limit.
     *
     * @var int
     */
    public int $fileLimit = 0;
    
    /**
     * The user limit.
     *
     * @var int
     */
    public int $userLimit = 0;
    
    /**
     * {@inheritdoc}
     */
    public function getDefaultOption() : ?string {
        return 'fileLimit';
    }

}

Members

Title Sort descending Modifiers Object type Summary
FileSizeLimitConstraint::$diskQuotaMessage public property The message for when disk quota is exceeded.
FileSizeLimitConstraint::$fileLimit public property The file limit.
FileSizeLimitConstraint::$maxFileSizeMessage public property The message for when file size limit is exceeded.
FileSizeLimitConstraint::$userLimit public property The user limit.
FileSizeLimitConstraint::getDefaultOption public function

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.