Save to database #13
@@ -14,14 +14,16 @@ final class ContributionCollection implements \IteratorAggregate, \Countable
|
||||
|
||||
public function __construct(Contribution ...$contributions)
|
||||
{
|
||||
$this->contributions = $contributions;
|
||||
$this->contributions = array_values($contributions);
|
||||
}
|
||||
|
||||
/** @return \ArrayIterator<int, Contribution> */
|
||||
public function getIterator(): \ArrayIterator
|
||||
{
|
||||
return new \ArrayIterator($this->contributions);
|
||||
}
|
||||
|
||||
/** Number of contributions held in this collection. */
|
||||
public function count(): int
|
||||
{
|
||||
return count($this->contributions);
|
||||
|
||||
Reference in New Issue
Block a user