| @@ 78-87 (lines=10) @@ | ||
| 75 | * |
|
| 76 | * @return array |
|
| 77 | */ |
|
| 78 | public function readSingle($id, $keyType = 'primary') |
|
| 79 | { |
|
| 80 | $query = $this->newQuery(); |
|
| 81 | $key = $this->returnKeyType($keyType); |
|
| 82 | ||
| 83 | $query->cols(['*']) |
|
| 84 | ->where("{$key} = {$id}"); |
|
| 85 | ||
| 86 | return $this->fireStatementAndReturn($query, true); |
|
| 87 | } |
|
| 88 | ||
| 89 | /** |
|
| 90 | * Reads all related records from the database |
|
| @@ 96-105 (lines=10) @@ | ||
| 93 | * |
|
| 94 | * @return array |
|
| 95 | */ |
|
| 96 | public function readAll($id, $keyType = 'primary') |
|
| 97 | { |
|
| 98 | $query = $this->newQuery(); |
|
| 99 | $key = $this->returnKeyType($keyType); |
|
| 100 | ||
| 101 | $query->cols(['*']) |
|
| 102 | ->where("{$key} = {$id}"); |
|
| 103 | ||
| 104 | return $this->fireStatementAndReturn($query); |
|
| 105 | } |
|
| 106 | ||
| 107 | public function returnKeyType($key) |
|
| 108 | { |
|