PluginProbe
The Innovative Form Builder – IvyForms / 0.3
The Innovative Form Builder – IvyForms v0.3
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Repository / BaseRepositoryInterface.php

BaseRepositoryInterface.php in The Innovative Form Builder – IvyForms 0.3, at backend/src/Repository/BaseRepositoryInterface.php

103 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\Repository;
4
5 // phpcs:disable PSR1.Files.SideEffects
6 if (!defined('ABSPATH')) {
7 exit; // Exit if accessed directly
8 }
9
10 /**
11 * Interface BaseRepositoryInterface
12 *
13 * @package IvyForms\Repository
14 */
15 interface BaseRepositoryInterface
16 {
17 /**
18 * Get an entity by ID.
19 *
20 * @param int $id
21 *
22 * @return object|null
23 */
24 public function getById(int $id): ?object;
25
26 /**
27 * Get all entities.
28 *
29 * @return mixed[]|null
30 */
31 public function getAll(): ?array;
32
33 /**
34 * Add an entity.
35 *
36 * @param object $entity
37 * @return int
38 */
39 public function add(object $entity): int;
40
41 /**
42 * Update an entity by ID.
43 *
44 * @param int $id
45 * @param object $entity
46 * @return bool
47 */
48 public function update(int $id, object $entity): bool;
49
50 /**
51 * Delete an entity by ID.
52 *
53 * @param int $id
54 * @return int
55 */
56 public function delete(int $id): int;
57
58 /**
59 * Delete many entities.
60 *
61 * @param array<int> $ids
62 *
63 * @return int
64 */
65 public function deleteMany(array $ids): int;
66
67 /**
68 * Search for entities based on parameters.
69 *
70 * @param array<string, mixed> $params
71 * @return array<mixed>
72 */
73 public function search(array $params): array;
74
75 /**
76 * Select query for retrieving data.
77 *
78 * @return string
79 */
80 public function selectQuery(): string;
81
82 /**
83 * Begin a database transaction.
84 *
85 * @return bool
86 */
87 public function beginTransaction(): bool;
88
89 /**
90 * Commit a database transaction.
91 *
92 * @return bool
93 */
94 public function commit(): bool;
95
96 /**
97 * Rollback a database transaction.
98 *
99 * @return bool
100 */
101 public function rollback(): bool;
102 }
103