| @@ -3,54 +3,84 @@ | ||
| 3 | 3 | if (! defined('ABSPATH')) { |
| 4 | 4 | exit; // Exit if accessed directly |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -use DI\Container; | |
| 7 | +use IvyForms\Repository\FieldOptions\FieldOptionsRepository; | |
| 8 | +use IvyForms\Repository\FieldOptions\FieldOptionsRepositoryInterface; | |
| 9 | +use IvyForms\Repository\Form\FormRepository; | |
| 10 | +use IvyForms\Repository\Form\FormRepositoryInterface; | |
| 11 | +use IvyForms\Repository\Field\FieldRepository; | |
| 12 | +use IvyForms\Repository\Field\FieldRepositoryInterface; | |
| 13 | +use IvyForms\Repository\Notification\NotificationRepository; | |
| 14 | +use IvyForms\Repository\Notification\NotificationRepositoryInterface; | |
| 8 | 15 | use IvyForms\Repository\Confirmation\ConfirmationRepository; |
| 9 | 16 | use IvyForms\Repository\Confirmation\ConfirmationRepositoryInterface; |
| 10 | 17 | use IvyForms\Repository\Entry\EntryRepository; |
| 11 | 18 | use IvyForms\Repository\Entry\EntryRepositoryInterface; |
| 19 | +use IvyForms\Repository\EntryField\EntryFieldNameEmailRepository; | |
| 20 | +use IvyForms\Repository\EntryField\EntryFieldNameEmailRepositoryInterface; | |
| 12 | 21 | use IvyForms\Repository\EntryField\EntryFieldRepository; |
| 13 | 22 | 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; | |
| 23 | +use IvyForms\Repository\GoogleSheets\GoogleSheetsRepository; | |
| 24 | +use IvyForms\Repository\GoogleSheets\GoogleSheetsRepositoryInterface; | |
| 25 | +use IvyForms\Repository\Payment\OrderRepository; | |
| 26 | +use IvyForms\Repository\Payment\OrderRepositoryInterface; | |
| 27 | +use IvyForms\Repository\Payment\PaymentRepository; | |
| 28 | +use IvyForms\Repository\Payment\PaymentRepositoryInterface; | |
| 29 | + | |
| 30 | +use IvyForms\Services\InstallActions\DB\FieldOptions\FieldOptionsTable; | |
| 31 | +use IvyForms\Services\InstallActions\DB\GoogleSheets\GoogleSheetsTable; | |
| 32 | +use IvyForms\Services\InstallActions\DB\Form\FormsTable; | |
| 33 | +use IvyForms\Services\InstallActions\DB\Field\FieldsTable; | |
| 34 | +use IvyForms\Services\InstallActions\DB\Notification\NotificationsTable; | |
| 20 | 35 | use IvyForms\Services\InstallActions\DB\Confirmation\ConfirmationsTable; |
| 21 | 36 | use IvyForms\Services\InstallActions\DB\Entry\EntriesTable; |
| 22 | 37 | 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; | |
| 38 | +use IvyForms\Services\InstallActions\DB\Payment\OrdersTable; | |
| 39 | +use IvyForms\Services\InstallActions\DB\Payment\PaymentsTable; | |
| 26 | 40 | |
| 27 | -/** @var Container $container */ | |
| 28 | -// @phpstan-ignore-next-line | |
| 29 | -$container->set(FormRepositoryInterface::class, static function () { | |
| 30 | - return new FormRepository(FormsTable::getTableName()); | |
| 31 | -}); | |
| 41 | +return [ | |
| 32 | 42 | |
| 33 | -// @phpstan-ignore class.notFound | |
| 34 | -$container->set(FieldRepositoryInterface::class, static function () { | |
| 35 | - return new FieldRepository(FieldsTable::getTableName()); | |
| 36 | -}); | |
| 43 | + FormRepositoryInterface::class => function () { | |
| 44 | + return new FormRepository(FormsTable::getTableName()); | |
| 45 | + }, | |
| 37 | 46 | |
| 38 | -// @phpstan-ignore class.notFound | |
| 39 | -$container->set(NotificationRepositoryInterface::class, static function () { | |
| 40 | - return new NotificationRepository(NotificationsTable::getTableName()); | |
| 41 | -}); | |
| 47 | + FieldRepositoryInterface::class => function () { | |
| 48 | + return new FieldRepository(FieldsTable::getTableName()); | |
| 49 | + }, | |
| 42 | 50 | |
| 43 | -// @phpstan-ignore class.notFound | |
| 44 | -$container->set(ConfirmationRepositoryInterface::class, static function () { | |
| 45 | - return new ConfirmationRepository(ConfirmationsTable::getTableName()); | |
| 46 | -}); | |
| 51 | + NotificationRepositoryInterface::class => function () { | |
| 52 | + return new NotificationRepository(NotificationsTable::getTableName()); | |
| 53 | + }, | |
| 47 | 54 | |
| 48 | -// @phpstan-ignore class.notFound | |
| 49 | -$container->set(EntryRepositoryInterface::class, static function () { | |
| 50 | - return new EntryRepository(EntriesTable::getTableName()); | |
| 51 | -}); | |
| 55 | + ConfirmationRepositoryInterface::class => function () { | |
| 56 | + return new ConfirmationRepository(ConfirmationsTable::getTableName()); | |
| 57 | + }, | |
| 52 | 58 | |
| 53 | -// @phpstan-ignore class.notFound | |
| 54 | -$container->set(EntryFieldRepositoryInterface::class, static function () { | |
| 55 | - return new EntryFieldRepository(EntryFieldsTable::getTableName()); | |
| 56 | -}); | |
| 59 | + EntryRepositoryInterface::class => function () { | |
| 60 | + return new EntryRepository(EntriesTable::getTableName()); | |
| 61 | + }, | |
| 62 | + | |
| 63 | + EntryFieldRepositoryInterface::class => function () { | |
| 64 | + return new EntryFieldRepository(EntryFieldsTable::getTableName()); | |
| 65 | + }, | |
| 66 | + | |
| 67 | + EntryFieldNameEmailRepositoryInterface::class => function () { | |
| 68 | + return new EntryFieldNameEmailRepository(EntryFieldsTable::getTableName()); | |
| 69 | + }, | |
| 70 | + | |
| 71 | + FieldOptionsRepositoryInterface::class => function () { | |
| 72 | + return new FieldOptionsRepository(FieldOptionsTable::getTableName()); | |
| 73 | + }, | |
| 74 | + | |
| 75 | + GoogleSheetsRepositoryInterface::class => function () { | |
| 76 | + return new GoogleSheetsRepository(GoogleSheetsTable::getTableName()); | |
| 77 | + }, | |
| 78 | + | |
| 79 | + PaymentRepositoryInterface::class => function () { | |
| 80 | + return new PaymentRepository(PaymentsTable::getTableName()); | |
| 81 | + }, | |
| 82 | + | |
| 83 | + OrderRepositoryInterface::class => function () { | |
| 84 | + return new OrderRepository(OrdersTable::getTableName()); | |
| 85 | + }, | |
| 86 | +]; | |