PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
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
← All changes | backend/src/Repository/AbstractRepository.php +3 -48 0.6.1-backup → 1.5 View file →
@@ -6,17 +6,13 @@
6 6 */
7 7
8 8 namespace IvyForms\Repository;
9 9
10 -// phpcs:disable PSR1.Files.SideEffects
11 -if (!defined('ABSPATH')) {
12 - exit; // Exit if accessed directly
13 -}
14 -
15 10 use IvyForms\Common\Exceptions\InvalidArgumentException;
16 11 use IvyForms\Common\Exceptions\NotFoundException;
17 12 use IvyForms\Common\Exceptions\QueryExecutionException;
18 13 use IvyForms\Services\Translations\BackendStrings;
14 +use IvyForms\Repository\ColumnRepositoryTrait;
19 15
20 16 /**
21 17 * Class AbstractRepository
22 18 *
@@ -23,8 +19,10 @@
23 19 * @package IvyForms\Repository
24 20 */
25 21 class AbstractRepository
26 22 {
23 + use ColumnRepositoryTrait;
24 +
27 25 public const FACTORY = '';
28 26
29 27 /** @var string */
30 28 protected string $table;
@@ -388,49 +386,6 @@
388 386 */
389 387 public function rollback(): bool
390 388 {
391 389 return (bool) $this->wpdb->query('ROLLBACK');
392 - }
393 -
394 - /**
395 - * @return string[]
396 - */
397 - protected function getSearchableColumns(): array
398 - {
399 - return ['id'];
400 - }
401 -
402 - /**
403 - * @return array<string, string>
404 - */
405 - protected function getFilterableColumns(): array
406 - {
407 - return [];
408 - }
409 -
410 - /**
411 - * @return string[]
412 - */
413 - protected function getSortableColumns(): array
414 - {
415 - return ['id'];
416 - }
417 -
418 - /**
419 - * @return string
420 - */
421 - protected function getDateColumn(): string
422 - {
423 - return 'dateCreated';
424 - }
425 -
426 - /**
427 - * Get allowed foreign key columns for deletion operations.
428 - * Override this method in child repositories to specify allowed columns.
429 - *
430 - * @return string[]
431 - */
432 - protected function getAllowedForeignColumns(): array
433 - {
434 - return ['formId', 'entryId', 'fieldId'];
435 390 }
436 391 }