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

DBLock   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 29
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A addPlayerLock() 0 3 1
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