| 1 |
<?php |
| 2 |
|
| 3 |
if (! defined('ABSPATH')) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
|
| 7 |
use DI\Container; |
| 8 |
use IvyForms\Repository\Confirmation\ConfirmationRepository; |
| 9 |
use IvyForms\Repository\Confirmation\ConfirmationRepositoryInterface; |
| 10 |
use IvyForms\Repository\Entry\EntryRepository; |
| 11 |
use IvyForms\Repository\Entry\EntryRepositoryInterface; |
| 12 |
use IvyForms\Repository\EntryField\EntryFieldRepository; |
| 13 |
use IvyForms\Repository\EntryField\EntryFieldRepositoryInterface; |
| 14 |
use IvyForms\Repository\Field\FieldRepository; |
| 15 |
use IvyForms\Repository\Field\FieldRepositoryInterface; |
| 16 |
use IvyForms\Repository\Form\FormRepository; |
| 17 |
use IvyForms\Repository\Form\FormRepositoryInterface; |
| 18 |
use IvyForms\Repository\Notification\NotificationRepository; |
| 19 |
use IvyForms\Repository\Notification\NotificationRepositoryInterface; |
| 20 |
use IvyForms\Services\InstallActions\DB\Confirmation\ConfirmationsTable; |
| 21 |
use IvyForms\Services\InstallActions\DB\Entry\EntriesTable; |
| 22 |
use IvyForms\Services\InstallActions\DB\EntryField\EntryFieldsTable; |
| 23 |
use IvyForms\Services\InstallActions\DB\Field\FieldsTable; |
| 24 |
use IvyForms\Services\InstallActions\DB\Form\FormsTable; |
| 25 |
use IvyForms\Services\InstallActions\DB\Notification\NotificationsTable; |
| 26 |
|
| 27 |
/** @var Container $container */ |
| 28 |
// @phpstan-ignore-next-line |
| 29 |
$container->set(FormRepositoryInterface::class, static function () { |
| 30 |
return new FormRepository(FormsTable::getTableName()); |
| 31 |
}); |
| 32 |
|
| 33 |
// @phpstan-ignore class.notFound |
| 34 |
$container->set(FieldRepositoryInterface::class, static function () { |
| 35 |
return new FieldRepository(FieldsTable::getTableName()); |
| 36 |
}); |
| 37 |
|
| 38 |
// @phpstan-ignore class.notFound |
| 39 |
$container->set(NotificationRepositoryInterface::class, static function () { |
| 40 |
return new NotificationRepository(NotificationsTable::getTableName()); |
| 41 |
}); |
| 42 |
|
| 43 |
// @phpstan-ignore class.notFound |
| 44 |
$container->set(ConfirmationRepositoryInterface::class, static function () { |
| 45 |
return new ConfirmationRepository(ConfirmationsTable::getTableName()); |
| 46 |
}); |
| 47 |
|
| 48 |
// @phpstan-ignore class.notFound |
| 49 |
$container->set(EntryRepositoryInterface::class, static function () { |
| 50 |
return new EntryRepository(EntriesTable::getTableName()); |
| 51 |
}); |
| 52 |
|
| 53 |
// @phpstan-ignore class.notFound |
| 54 |
$container->set(EntryFieldRepositoryInterface::class, static function () { |
| 55 |
return new EntryFieldRepository(EntryFieldsTable::getTableName()); |
| 56 |
}); |
| 57 |
|