Update openingHours model to add count

Needed countable for checking if model contains content.

Relates: werkraum-media#18
This commit is contained in:
svenfnzd 2021-04-14 11:00:00 +02:00 committed by Daniel Siepmann
parent 99b95ee3ed
commit 960d2debec

View file

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