Builders
StatementLeadBuilder
Fluent builder for constructing StatementLead consent entries for leads.
Namespace and purpose
Imoli\EflLeasingSdk\Builder\StatementLeadBuilder is a fluent helper for building StatementLead instances.
It represents a single statement/consent associated with a lead in contact forms.
Class definition
- Namespace:
Imoli\EflLeasingSdk\Builder - Class: final
StatementLeadBuilder - Builds:
Imoli\EflLeasingSdk\Model\Lead\StatementLead
namespace Imoli\EflLeasingSdk\Builder;
use Imoli\EflLeasingSdk\Model\Lead\StatementLead;
final class StatementLeadBuilder
{
public function withStatementConfigurationId(int $statementConfigurationId): self;
public function withStatementCategoryId(?int $statementCategoryId): self;
public function withSelected(?bool $selected): self;
public function build(): StatementLead;
public static function create(int $statementConfigurationId): self;
}
Fluent API
- withStatementConfigurationId(int $statementConfigurationId): self
Sets the statement configuration identifier (required). - withStatementCategoryId(?int $statementCategoryId): self
Optionally sets the category identifier for the statement. - withSelected(?bool $selected): self
Optionally marks the statement as selected/accepted (true), rejected (false) or unspecified (null). - build(): StatementLead
- Requires
statementConfigurationIdto be set. - Throws
\LogicExceptionif it is missing. - Returns a new
StatementLeadinstance.
- Requires
- static create(int $statementConfigurationId): self
Convenience factory that sets the required configuration identifier.
Usage example
use Imoli\EflLeasingSdk\Builder\StatementLeadBuilder;
$statementLead = StatementLeadBuilder::create(1001)
->withSelected(true)
->build();