Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
scrs_zdenek committed Aug 13, 2024
1 parent 0d5b469 commit d476bc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Drago/Database/Records.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ trait Records
* @throws AttributeDetectionException
* @throws Exception
*/
public function getOne(...$cond): mixed
public function one(...$cond): mixed
{
return $this->fetch($this->table(...$cond));
}
Expand All @@ -54,7 +54,7 @@ public function getById(int $id): mixed
* @throws Exception
* @throws AttributeDetectionException
*/
public function getAll(?int $offset = null, ?int $limit = null): array
public function all(?int $offset = null, ?int $limit = null): array
{
return $this->fetchAll($this->table(), $offset, $limit);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Database/Records.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test('Find record by id', function () {


test('Find record by column name', function () {
$row = records()->getOne('sample = ?', 'Hello');
$row = records()->one('sample = ?', 'Hello');

Assert::same('Hello', $row->sample);
});
Expand Down

0 comments on commit d476bc1

Please sign in to comment.