mirror of
https://github.com/werkraum-media/thuecat.git
synced 2024-09-29 03:36:12 +02:00
Update offers model to add count
Needed countable for checking if model contains content. Relates: #18
This commit is contained in:
parent
c73bf1c53a
commit
99b95ee3ed
1 changed files with 6 additions and 1 deletions
|
@ -28,7 +28,7 @@ use TYPO3\CMS\Core\Type\TypeInterface;
|
||||||
/**
|
/**
|
||||||
* @implements \Iterator<int, Offer>
|
* @implements \Iterator<int, Offer>
|
||||||
*/
|
*/
|
||||||
class Offers implements TypeInterface, \Iterator
|
class Offers implements TypeInterface, \Iterator, \Countable
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
|
@ -83,4 +83,9 @@ class Offers implements TypeInterface, \Iterator
|
||||||
{
|
{
|
||||||
$this->position = 0;
|
$this->position = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function count()
|
||||||
|
{
|
||||||
|
return count($this->array);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue