src/Db/ImageBMapper.php
public function getByRef(ARef $ref, $asUnitMember = false)
    {
        $ownerType = $ref->getType();
        $type_name = $ownerType->getName();
        $typeRank = $ownerType->getRank();

        $key = $type_name.'_'.$ref->getId();

        if($typeRank === TypeRank::GROUP and $asUnitMember)
        {
            $selectionUnit = $this->tuner->getSelection($type_name, 'group');

            return $this->select($selectionUnit);
        }

        if(array_key_exists($key, $this->units))
        {
            return $this->units[$key];
        }

        $imagesQuery = $this->imageQuerier->selectImagesByRef($ref);
        $resizesQuery = $this->imageQuerier->selectResizesByRef($ref);
        $cropsQuery = $this->imageQuerier->selectCropsByRef($ref);

        $images_result = Helpers::laravel_db_result_to_array($imagesQuery->get());
        $resizes_result = Helpers::laravel_db_result_to_array($resizesQuery->get());
        $crops_result = Helpers::laravel_db_result_to_array($cropsQuery->get());

        $collection = $this->resultsToCollection($ownerType, $images_result, $resizes_result, $crops_result);

        $this->units[$key] = $collection;

        return $collection;
    }
public function getByRef(ARef $ref, $asUnitMember = false)
    {
        $ownerType = $ref->getType();
        $type_name = $ownerType->getName();
        $typeRank = $ownerType->getRank();

        $key = $type_name.'_'.$ref->getId();

        if($typeRank === TypeRank::GROUP and $asUnitMember)
        {
            $selectionUnit = $this->tuner->getSelection($type_name, 'group');

            return $this->select($selectionUnit);
        }

        if(array_key_exists($key, $this->units))
        {
            return $this->units[$key];
        }

        $imagesQuery = $this->imageQuerier->selectImagesByRef($ref);
        $resizesQuery = $this->imageQuerier->selectResizesByRef($ref);
        $cropsQuery = $this->imageQuerier->selectCropsByRef($ref);

        $images_result = Helpers::laravel_db_result_to_array($imagesQuery->get());
        $resizes_result = Helpers::laravel_db_result_to_array($resizesQuery->get());
        $crops_result = Helpers::laravel_db_result_to_array($cropsQuery->get());

        $collection = $this->resultsToCollection($ownerType, $images_result, $resizes_result, $crops_result);

        $this->units[$key] = $collection;

        return $collection;
    }
@param \Interpro\Core\Contracts\Ref\ARef $ref
@param bool $asUnitMember

@return \Interpro\Extractor\Contracts\Collections\MapBCollection