public function getEntityCount(IEntity $parent = NULL)
 {
     if ($this->relationshipMapper) {
         return $this->relationshipMapper->getIteratorCount($parent, $this);
     }
     return $this->getIteratorCount();
 }
 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));
     }
 }