Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
attach.php
1
<?php
2
3
4
namespace
Bitrix\Calendar\ICal\Builder
;
5
6
7
use Bitrix\Calendar\SerializeObject;
8
use Serializable;
9
10
class
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
}
Bitrix\Calendar\ICal\Builder\Attach
Definition
attach.php:11
Bitrix\Calendar\ICal\Builder\Attach\getName
getName()
Definition
attach.php:53
Bitrix\Calendar\ICal\Builder\Attach\getFormatSize
getFormatSize($precision=2)
Definition
attach.php:74
Bitrix\Calendar\ICal\Builder\Attach\createInstance
static createInstance(string $link, string $name, int $size)
Definition
attach.php:32
Bitrix\Calendar\ICal\Builder\Attach\getSize
getSize()
Definition
attach.php:69
Bitrix\Calendar\ICal\Builder\Attach\getLink
getLink()
Definition
attach.php:61
Bitrix\Calendar\ICal\Builder\Attach\__construct
__construct(string $link, string $name, int $size)
Definition
attach.php:43
Bitrix\Calendar\ICal\Builder
Definition
alert.php:4
modules
calendar
lib
ical
builder
attach.php
Создано системой
1.10.0