Builders
CustomerDataStatementBuilder
Fluent builder for constructing CustomerDataStatement consent entries.
Namespace and purpose
Imoli\EflLeasingSdk\Builder\CustomerDataStatementBuilder is a fluent helper for building CustomerDataStatement instances.
It represents a single customer statement/consent attached to customer data.
Class definition
- Namespace:
Imoli\EflLeasingSdk\Builder - Class: final
CustomerDataStatementBuilder - Builds:
Imoli\EflLeasingSdk\Model\Customer\CustomerDataStatement
namespace Imoli\EflLeasingSdk\Builder;
use Imoli\EflLeasingSdk\Model\Customer\CustomerDataStatement;
final class CustomerDataStatementBuilder
{
public function withGuid(string $guid): self;
public function withAgreement(bool $agreement): self;
public function withStatementTypeId(string $statementTypeId): self;
public function withValidFrom(?string $validFrom): self;
public function build(): CustomerDataStatement;
public static function create(string $guid, bool $agreement, string $statementTypeId): self;
}
Fluent API
- withGuid(string $guid): self – sets the statement GUID.
- withAgreement(bool $agreement): self – sets whether the statement is accepted.
- withStatementTypeId(string $statementTypeId): self – sets the statement type identifier.
- withValidFrom(?string $validFrom): self – optionally sets the start date of validity.
- build(): CustomerDataStatement
- Requires:
guid,agreement,statementTypeId. - Throws
\LogicExceptionif any of them is missing. - Returns a new
CustomerDataStatementinstance.
- Requires:
- static create(string $guid, bool $agreement, string $statementTypeId): self
Convenience factory that sets required fields and returns a builder ready for optionalvalidFrom.
Usage example
use Imoli\EflLeasingSdk\Builder\CustomerDataStatementBuilder;
$statement = CustomerDataStatementBuilder::create('stmt-guid', true, 'RODO')
->withValidFrom('2024-01-01')
->build();