Add method chaining instead of multiple method arguments #10

Merged
vlw merged 3 commits from refs/pull/10/head into master 2023-10-26 15:00:05 +02:00
vlw commented 2023-10-26 14:06:13 +02:00 (Migrated from codeberg.org)

This PR replaces arguments passed to each method with method chaining instead.

For example

$db->get(
  string $table,
  array|string $columns,
  ?array $filter = null,
  ?array $order_by = null,
  int|array|null $limit = null
): array|bool;

becomes

$db->for(string $table)
->with(array $model)
->where(array $filters)
->order(array $order_by)
->limit(1)
->select(array $columns): array|bool;

Full documentation will be added to the README.

This also closes #9

This PR replaces arguments passed to each method with method chaining instead. For example ```php $db->get( string $table, array|string $columns, ?array $filter = null, ?array $order_by = null, int|array|null $limit = null ): array|bool; ``` becomes ```php $db->for(string $table) ->with(array $model) ->where(array $filters) ->order(array $order_by) ->limit(1) ->select(array $columns): array|bool; ``` Full documentation will be added to the README. This also closes #9
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
vlw/php-mysql!10
No description provided.