-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathStreamingTransactionCollection.php
102 lines (89 loc) · 2.12 KB
/
StreamingTransactionCollection.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
/**
* ArangoDB PHP client: streaming transaction collection
*
* @package ArangoDBClient
* @author Jan Steemann
* @copyright Copyright 2019, ArangoDB GmbH, Cologne, Germany
*/
namespace ArangoDBClient;
/**
* Streaming transaction collection object
*
* @package ArangoDBClient
* @since 3.5
*/
class StreamingTransactionCollection extends Collection
{
/**
* The transaction - assigned on construction
*
* @var StreamingTransaction - transaction
*/
private $_trx;
/**
* Collection name - assigned on construction
*
* @var string - collection name
*/
private $_name;
/**
* Lock mode for this collection, i.e. 'read', 'write' or 'exclusive'
*
* @var string - lock mode
*/
private $_mode;
/**
* Constructs a streaming transaction collection object
*
* @param StreamingTransaction $trx - the transaction
* @param string $name - collection name
* @param string $mode - lock mode, i.e. 'read', 'write', 'exclusive'
*/
public function __construct(StreamingTransaction $trx, $name, $mode)
{
parent::__construct($name);
$this->_trx = $trx;
$this->_name = $name;
$this->_mode = $mode;
}
/**
* Return the name of the collection
*
* @magic
*
* @return string - collection name
*/
public function __toString()
{
return $this->_name;
}
/**
* Return the name of the collection
*
* @return string - collection name
*/
public function getName()
{
return $this->_name;
}
/**
* Return the lock mode of the collection
*
* @return string - lock mode, i.e. 'read', 'write', 'exclusive'
*/
public function getMode()
{
return $this->_mode;
}
/**
* Return the transaction's id
*
* @return string - transaction id
*/
public function getTrxId()
{
return $this->_trx->getId();
}
}
class_alias(Transaction::class, '\triagens\ArangoDb\StreamingTransactionCollection');