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

DbRowSimple::getById()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
nc 1
nop 2
dl 0
loc 11
rs 9.4285
c 1
b 0
f 0
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