-
Notifications
You must be signed in to change notification settings - Fork 0
/
AlorInstrument.php
56 lines (48 loc) · 988 Bytes
/
AlorInstrument.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
namespace Src\BrokerAPI\Alor;
use Src\BrokerAPI\Alor\Interfaces\AlorConstants;
class AlorInstrument
{
/**
* @var string
*/
public $ticker;
/**
* @var string
*/
public $exchange;
/**
* Конструктор AlorInstrument
*
* @param string $ticker
* @param string $exchange
*/
public function __construct(
$ticker,
$exchange = AlorConstants::EXCHANGE_DEFAULT
) {
$this->ticker = $ticker;
$this->exchange = $exchange;
}
/**
* Получение в виде массива
*
* @return array
*/
public function asArray()
{
return [
'symbol' => $this->ticker,
'exchange' => $this->exchange,
];
}
/**
* Получение в виде строки
*
* @return string
*/
public function __toString()
{
return $this->exchange . ':' . $this->ticker;
}
}