|
|
@@ -17,6 +17,7 @@ namespace Cake\Collection;
|
|
|
use ArrayIterator;
|
|
|
use InvalidArgumentException;
|
|
|
use IteratorIterator;
|
|
|
+use LogicException;
|
|
|
use Serializable;
|
|
|
use Traversable;
|
|
|
|
|
|
@@ -72,6 +73,20 @@ class Collection extends IteratorIterator implements CollectionInterface, Serial
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Throws an exception.
|
|
|
+ *
|
|
|
+ * Issuing a count on a Collection can have many side effects, some making the
|
|
|
+ * Collection unusable after the count operation.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ * @throws \LogicException
|
|
|
+ */
|
|
|
+ public function count()
|
|
|
+ {
|
|
|
+ throw new LogicException('You cannot issue a count on a Collection.');
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Returns an array that can be used to describe the internal state of this
|
|
|
* object.
|
|
|
*
|