public function getAreaProvidersCollection()
    {
        $collection = new Collection;

        foreach ($this->providers as $model) {
            $area = $this->areaManager->getById($model->area);
            if (is_null($area)) {
                continue;
            }

            $areaProviders = $collection->get($area->getId());
            if ($areaProviders === null) {
                $areaProviders = new AreaProviders($area);
                $areaProviders->addModel($model);
                $collection->put($area->getId(), $areaProviders);
            } else {
                $areaProviders->addModel($model);
            }
        }

        return $collection;
    }
public function getAreaProvidersCollection()
    {
        $collection = new Collection;

        foreach ($this->providers as $model) {
            $area = $this->areaManager->getById($model->area);
            if (is_null($area)) {
                continue;
            }

            $areaProviders = $collection->get($area->getId());
            if ($areaProviders === null) {
                $areaProviders = new AreaProviders($area);
                $areaProviders->addModel($model);
                $collection->put($area->getId(), $areaProviders);
            } else {
                $areaProviders->addModel($model);
            }
        }

        return $collection;
    }
public function getAreaProvidersCollection ( ) { $ collection = new Collection ; foreach ( $ this -> providers as $ model ) { $ area = $ this -> areaManager -> getById ( $ model -> area ) ; if ( is_null ( $ area ) ) { continue ; } $ areaProviders = $ collection -> get ( $ area -> getId ( ) ) ; if ( $ areaProviders === null ) { $ areaProviders = new AreaProviders ( $ area ) ; $ areaProviders -> addModel ( $ model ) ; $ collection -> put ( $ area -> getId ( ) , $ areaProviders ) ; } else { $ areaProviders -> addModel ( $ model ) ; } } return $ collection ; }
Returns the collection with areas and providers for each one.

@return Collection
Returns the collection with areas and providers for each one .