public function getEntityIterator(IEntity $parent = null)
{
if ($parent && $this->relationshipMapper) {
$collection = clone $this;
$collection->relationshipMapper = null;
$collection->relationshipParent = null;
return $this->relationshipMapper->getIterator($parent, $collection);
} else {
$this->processData();
return new EntityIterator(array_values($this->data));
}
}