| 1 |
<?php |
| 2 |
|
| 3 |
if (! defined('ABSPATH')) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
|
| 7 |
use IvyForms\Vendor\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\FieldOptions\FieldOptionsRepository; |
| 17 |
use IvyForms\Repository\FieldOptions\FieldOptionsRepositoryInterface; |
| 18 |
use IvyForms\Repository\Form\FormRepository; |
| 19 |
use IvyForms\Repository\Form\FormRepositoryInterface; |
| 20 |
use IvyForms\Repository\Notification\NotificationRepository; |
| 21 |
use IvyForms\Repository\Notification\NotificationRepositoryInterface; |
| 22 |
use IvyForms\Services\InstallActions\DB\Confirmation\ConfirmationsTable; |
| 23 |
use IvyForms\Services\InstallActions\DB\Entry\EntriesTable; |
| 24 |
use IvyForms\Services\InstallActions\DB\EntryField\EntryFieldsTable; |
| 25 |
use IvyForms\Services\InstallActions\DB\Field\FieldsTable; |
| 26 |
use IvyForms\Services\InstallActions\DB\Form\FormsTable; |
| 27 |
use IvyForms\Services\InstallActions\DB\Notification\NotificationsTable; |
| 28 |
use IvyForms\Services\InstallActions\DB\FieldOptions\FieldOptionsTable; |
| 29 |
|
| 30 |
/** @var Container $container */ |
| 31 |
// @phpstan-ignore-next-line |
| 32 |
$container->set(FormRepositoryInterface::class, static function () { |
| 33 |
return new FormRepository(FormsTable::getTableName()); |
| 34 |
}); |
| 35 |
|
| 36 |
// @phpstan-ignore class.notFound |
| 37 |
$container->set(FieldRepositoryInterface::class, static function () { |
| 38 |
return new FieldRepository(FieldsTable::getTableName()); |
| 39 |
}); |
| 40 |
|
| 41 |
// @phpstan-ignore class.notFound |
| 42 |
$container->set(NotificationRepositoryInterface::class, static function () { |
| 43 |
return new NotificationRepository(NotificationsTable::getTableName()); |
| 44 |
}); |
| 45 |
|
| 46 |
// @phpstan-ignore class.notFound |
| 47 |
$container->set(ConfirmationRepositoryInterface::class, static function () { |
| 48 |
return new ConfirmationRepository(ConfirmationsTable::getTableName()); |
| 49 |
}); |
| 50 |
|
| 51 |
// @phpstan-ignore class.notFound |
| 52 |
$container->set(EntryRepositoryInterface::class, static function () { |
| 53 |
return new EntryRepository(EntriesTable::getTableName()); |
| 54 |
}); |
| 55 |
|
| 56 |
// @phpstan-ignore class.notFound |
| 57 |
$container->set(EntryFieldRepositoryInterface::class, static function () { |
| 58 |
return new EntryFieldRepository(EntryFieldsTable::getTableName()); |
| 59 |
}); |
| 60 |
|
| 61 |
// @phpstan-ignore class.notFound |
| 62 |
$container->set(FieldOptionsRepositoryInterface::class, static function () { |
| 63 |
return new FieldOptionsRepository(FieldOptionsTable::getTableName()); |
| 64 |
}); |
| 65 |
|
| 66 |
// @phpstan-ignore class.notFound |
| 67 |
$container->set(FieldOptionsRepository::class, static function () { |
| 68 |
return new FieldOptionsRepository(FieldOptionsTable::getTableName()); |
| 69 |
}); |
| 70 |
|