Code Duplication    Length = 2-5 lines in 3 locations

include/classes/base.class.php 1 location

@@ 159-160 (lines=2) @@
156
  public function getCount() {
157
    $this->debug->append("STA " . __METHOD__, 4);
158
    $stmt = $this->mysqli->prepare("SELECT COUNT(id) AS count FROM $this->table");
159
    if ($this->checkStmt($stmt) && $stmt->execute() && $result = $stmt->get_result())
160
      return $result->fetch_object()->count;
161
    return $this->sqlError();
162
  }
163

include/classes/share.class.php 1 location

@@ 65-66 (lines=2) @@
62
   **/
63
  public function getLastInsertedShareId() {
64
    $stmt = $this->mysqli->prepare("SELECT MAX(id) AS id FROM $this->table");
65
    if ($this->checkStmt($stmt) && $stmt->execute() && $result = $stmt->get_result())
66
      return $result->fetch_object()->id;
67
    return $this->sqlError();
68
  }
69

include/classes/transaction.class.php 1 location

@@ 89-93 (lines=5) @@
86
      if (!($this->checkStmt($stmt) && call_user_func_array( array($stmt, 'bind_param'), $this->getParam()) && $stmt->execute()))
87
        return false;
88
      $result = $stmt->get_result();
89
    } else {
90
      if (!($this->checkStmt($stmt) && $stmt->execute()))
91
        return false;
92
      $result = $stmt->get_result();
93
    }
94
    if ($result) {
95
      $aData = NULL;
96
      while ($row = $result->fetch_assoc()) {