Completed
Push — work-fleets ( 9cd586...f0ff6c )
by SuperNova.WS
04:56
created

DBLock::addPlayerLock()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
4
/**
5
 * Class DBLock
6
 */
7
class DBLock {
8
9
  /**
10
   * @var DBRow
11
   */
12
  public $initiator;
13
14
  /**
15
   * Array of locks for player
16
   * [$table.'+'.$linked_player_id] => array($table, $linked_player_id)
17
   *
18
   * @var string[][]
19
   */
20
  public $lock_player = array();
21
22
  /**
23
   * DBLock constructor.
24
   *
25
   * @param DBRow $initiator - Object that initiates lock
26
   */
27
  public function __construct($initiator) {
28
    $this->initiator = $initiator;
29
  }
30
31
32
  public function addPlayerLock($table, $playerIdFieldName) {
33
    $this->lock_player[$table . '-' . $playerIdFieldName] = array($table, $playerIdFieldName);
34
  }
35
}
36