Skip to content

Commit

Permalink
Update ListFieldTrait.php
Browse files Browse the repository at this point in the history
  • Loading branch information
bobdenotter committed Jun 23, 2020
1 parent 67fdc9e commit 66fef6e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Entity/ListFieldTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ public function count(): int
return count($this->getValue());
}

/**
* Makes ListFieldInterface fields .length attribute
* return the number of elements in the field
*/
public function length(): int
{
return $this->count();
}

public function current(): Field
{
return $this->fields[$this->iteratorCursor];
Expand Down

0 comments on commit 66fef6e

Please sign in to comment.