1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
attach.php
См. документацию.
1<?php
2
3
4namespace Bitrix\Calendar\ICal\Builder;
5
6
7use Bitrix\Calendar\SerializeObject;
8use Serializable;
9
10class Attach implements Serializable
11{
12 use SerializeObject;
16 private $link;
20 private $name;
24 private $size;
25
32 public static function createInstance(string $link, string $name, int $size): Attach
33 {
34 return new self($link, $name, $size);
35 }
36
43 public function __construct(string $link, string $name, int $size)
44 {
45 $this->link = $link;
46 $this->name = $name;
47 $this->size = $size;
48 }
49
53 public function getName(): string
54 {
55 return $this->name;
56 }
57
61 public function getLink(): string
62 {
63 return $this->link;
64 }
65
69 public function getSize(): int
70 {
71 return $this->size;
72 }
73
74 public function getFormatSize($precision = 2): string
75 {
76 $suffix = array('b', 'Kb', 'Mb', 'Gb', 'Tb');
77 $pos = 0;
78 $size = $this->size;
79 while($size >= 1024 && $pos < 4)
80 {
81 $size /= 1024;
82 $pos++;
83 }
84
85 return round($size, $precision) . ' ' . $suffix[$pos];
86 }
87}
getFormatSize($precision=2)
Определения attach.php:74
static createInstance(string $link, string $name, int $size)
Определения attach.php:32
__construct(string $link, string $name, int $size)
Определения attach.php:43
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$name
Определения menu_edit.php:35
font size
Определения invoice.php:442
$precision
Определения template.php:403