Skip to content
Snippets Groups Projects
Commit 71c572d1 authored by Maus, David's avatar Maus, David
Browse files

Fix Borrower and Membership classes

parent 3a256e2c
Branches
No related tags found
No related merge requests found
......@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace SUBHH\LBS4\BorrowerUpdate\Model;
use DateTimeImmutable;
use SUBHH\LBS4\BorrowerUpdate\BorrowerUpdateAction;
use SplObjectStorage;
final class Borrower
......@@ -46,6 +45,7 @@ final class Borrower
public function __construct (string $registrationNumber)
{
$this->memberships = new SplObjectStorage();
$this->registrationNumber = new StringField('101', $registrationNumber);
}
......@@ -188,7 +188,7 @@ final class Borrower
usort($fields, 'SUBHH\LBS4\BorrowerUpdate\Model\Field::compareTags');
foreach ($this->memberships as $membership) {
$fields[] = new StringField('200', $this->memberships->offsetGet($membership));
$fields[] = new StringField('200', $this->memberships->offsetGet($membership)->value);
$fields = array_merge($fields, $membership->getFields());
}
foreach ($this->addresses as $address) {
......
......@@ -11,9 +11,6 @@ final class Membership
private IntField $departmentGroup;
private DateField $expirationDate;
/** @var Field[] */
private array $fields = array();
public function __construct (int $departmentGroup, DateTimeImmutable $expirationDate)
{
$this->departmentGroup = new IntField('201', $departmentGroup);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment