Completed
Push — work-fleets ( 73ed38...ce5b3a )
by SuperNova.WS
05:53
created

DbRowSimple   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getById() 0 11 1
1
<?php
2
3
class DbRowSimple {
4
5
  /**
6
   * @param Entity $object
7
   * @param mixed  $rowId
8
   *
9
   * @return Entity
10
   */
11
  public function getById($object, $rowId) {
12
    $stmt = classSupernova::$gc->query
0 ignored issues
show
Bug introduced by
The method setIdField cannot be called on \classSupernova::$gc->query (of type callable).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
13
      ->setIdField($object::$idField)
14
      ->field('*')
15
      ->from($object::$tableName)
16
      ->where($object::$idField . ' = "' . $rowId . '"');
17
18
    $object->row = $stmt->selectRow();
19
20
    return $object;
21
  }
22
23
}
24