Skip to content

Commit

Permalink
Merge branch 'hotfix/3.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mridang Agarwalla committed May 9, 2017
2 parents 516ad37 + f8566ce commit 0fa728c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Object/AbstractCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@

namespace Nosto\Object;

use Countable;
use Iterator;

/**
* Base class for all Nosto object collection classes. The base class provides the
* functionality to validate the items added to the collection. The collection behaves
* like an array. making it easy to add items to it and iterate over it.
*/
abstract class AbstractCollection implements Iterator
abstract class AbstractCollection implements Iterator, Countable
{

protected $var = array();
Expand Down Expand Up @@ -80,6 +81,14 @@ public function next()
return next($this->var);
}

/**
* @see Iterator::next()
*/
public function count()
{
return count($this->var);
}

/**
* @see Iterator::valid()
*/
Expand Down

0 comments on commit 0fa728c

Please sign in to comment.