PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / src / EventTickets / Actions / RenderDonationFormBlock.php

RenderDonationFormBlock.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/EventTickets/Actions/RenderDonationFormBlock.php

31 lines 900 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\EventTickets\Actions;
4
5 use Give\EventTickets\Fields\EventTickets;
6 use Give\Framework\Blocks\BlockModel;
7 use Give\Framework\FieldsAPI\Contracts\Node;
8 use Give\Framework\FieldsAPI\Exceptions\EmptyNameException;
9
10 class RenderDonationFormBlock
11 {
12 /**
13 * Renders the EventTickets field for the donation form block.
14 *
15 * @param Node|null $node The node instance.
16 * @param BlockModel $block The block model instance.
17 * @param int $blockIndex The index of the block.
18 *
19 * @return EventTickets The EventTickets field instance.
20 * @throws EmptyNameException
21 */
22 public function __invoke(?Node $node, BlockModel $block, int $blockIndex, int $formId): ?Node
23 {
24 if ( ! $block->getAttribute('eventId')) {
25 return $node;
26 }
27
28 return (give(ConvertEventTicketsBlockToFieldsApi::class))($block, $formId);
29 }
30 }
31