PluginProbe
The Innovative Form Builder – IvyForms / 0.1.2
The Innovative Form Builder – IvyForms v0.1.2
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.1.2, at backend/src/Repository/BaseRepositoryInterface.php

94 lines 1.6 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 * Search for entities based on parameters.
60 *
61 * @param array<string, mixed> $params
62 * @return array<mixed>
63 */
64 public function search(array $params): array;
65
66 /**
67 * Select query for retrieving data.
68 *
69 * @return string
70 */
71 public function selectQuery(): string;
72
73 /**
74 * Begin a database transaction.
75 *
76 * @return bool
77 */
78 public function beginTransaction(): bool;
79
80 /**
81 * Commit a database transaction.
82 *
83 * @return bool
84 */
85 public function commit(): bool;
86
87 /**
88 * Rollback a database transaction.
89 *
90 * @return bool
91 */
92 public function rollback(): bool;
93 }
94