/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Collection
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Collection/Collection.php (3219B)
buffered());
}
/**
* Returns an array for serializing this of this object.
*
* @return array
*/
public function __serialize(): array
{
return $this->buffered()->toArray();
}
/**
* Unserializes the passed string and rebuilds the Collection instance
*
* @param string $collection The serialized collection
* @return void
*/
public function unserialize($collection): void
{
$this->__construct(unserialize($collection));
}
/**
* Rebuilds the Collection instance.
*
* @param array $data Data array.
* @return void
*/
public function __unserialize(array $data): void
{
$this->__construct($data);
}
/**
* {@inheritDoc}
*
* @return int
*/
public function count(): int
{
$traversable = $this->optimizeUnwrap();
if (is_array($traversable)) {
return count($traversable);
}
return iterator_count($traversable);
}
/**
* {@inheritDoc}
*
* @return int
*/
public function countKeys(): int
{
return count($this->toArray());
}
/**
* Returns an array that can be used to describe the internal state of this
* object.
*
* @return array
*/
public function __debugInfo(): array
{
try {
$count = $this->count();
} catch (Exception $e) {
$count = 'An exception occurred while getting count';
}
return [
'count' => $count,
];
}
}