Skip to content

Commit

Permalink
OWN-152 Create service to analyze report data
Browse files Browse the repository at this point in the history
  • Loading branch information
flancer64 committed May 14, 2020
1 parent 0dcdd73 commit 6359f57
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions App/Repo/Dao/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ public function deleteOne($pk)

public function deleteSet($where)
{
$result = null;
/* TODO: implement entity deletion by clause */
$conn = $this->resource->getConnection();
$tbl = $this->getTableName();
$result = $conn->delete($tbl, $where);
return $result;
}

Expand Down Expand Up @@ -174,9 +175,15 @@ public function getSet(
$conn = $this->resource->getConnection();
$query = $conn->select();
$query->from($tbl, '*');
if ($where) $query->where($where);
if ($order) $query->order($order);
if ($limit) $query->limit($limit, $offset);
if ($where) {
$query->where($where);
}
if ($order) {
$query->order($order);
}
if ($limit) {
$query->limit($limit, $offset);
}

$rs = $conn->fetchAll($query, $bind);
foreach ($rs as $one) {
Expand Down Expand Up @@ -243,4 +250,4 @@ public function updateSet($data, $where)
/* TODO: implement entity update by clause */
return $result;
}
}
}

0 comments on commit 6359f57

Please sign in to comment.