You are here

public function Asset::setSize in Mini site 8

Set asset size.

Parameters

int $size: The size in bytes.

Overrides AssetInterface::setSize

1 call to Asset::setSize()
Asset::__construct in src/Asset.php
Asset constructor.

File

src/Asset.php, line 440

Class

Asset
Class Asset.

Namespace

Drupal\minisite

Code

public function setSize($size) {
  if (!empty($size)) {
    $this->size = $size;
  }
  else {
    $size = $this
      ->calcFileSize($this
      ->getUri());
    if ($size) {
      $this->size = $size;
    }
  }
}