Update offers model to add count

Needed countable for checking if model contains content.

Relates: #18
This commit is contained in:
svenfnzd 2021-04-14 10:58:03 +02:00 committed by Daniel Siepmann
parent c73bf1c53a
commit 99b95ee3ed

View file

@ -28,7 +28,7 @@ use TYPO3\CMS\Core\Type\TypeInterface;
/**
* @implements \Iterator<int, Offer>
*/
class Offers implements TypeInterface, \Iterator
class Offers implements TypeInterface, \Iterator, \Countable
{
/**
* @var string
@ -83,4 +83,9 @@ class Offers implements TypeInterface, \Iterator
{
$this->position = 0;
}
public function count()
{
return count($this->array);
}
}