EFL
Builders

ContactDataBuilder

Fluent builder for constructing ContactData payloads for lead/contact forms.

Namespace and purpose

Imoli\EflLeasingSdk\Builder\ContactDataBuilder is a fluent helper for building ContactData instances. It is used with /Lead/SendContactForm via EflClient::sendContactForm() and LeadApiClient::sendContactForm().

Class definition

  • Namespace: Imoli\EflLeasingSdk\Builder
  • Class: final ContactDataBuilder
  • Builds: Imoli\EflLeasingSdk\Model\Lead\ContactData
namespace Imoli\EflLeasingSdk\Builder;

use Imoli\EflLeasingSdk\Model\Lead\ContactData;
use Imoli\EflLeasingSdk\Model\Lead\Prospect;
use Imoli\EflLeasingSdk\Model\Lead\StatementLead;

final class ContactDataBuilder
{
    public function withProspect(Prospect $prospect): self;

    public function addStatementLead(StatementLead $statementLead): self;

    public function build(): ContactData;
}

Fluent API

  • withProspect(Prospect $prospect): self
    Sets the lead prospect details (name, tax id, contact information).
  • addStatementLead(StatementLead $statementLead): self
    Appends a StatementLead consent entry to the statementLeads list.
  • build(): ContactData
    • Requires prospect to be set.
    • Throws \LogicException if prospect is missing.
    • Returns a new ContactData instance with the collected statementLeads.

Usage example

use Imoli\EflLeasingSdk\Builder\ContactDataBuilder;

$contactData = (new ContactDataBuilder())
    ->withProspect($prospect)
    ->addStatementLead($statementLead)
    ->build();