AdminModule/presenters/BasePresenter.php
public function collectionToArray($collection, $title = 'title')
     {
         $array = array();
         foreach ($collection as $item) {
             $getter = 'get'.ucfirst($title);
             $array[$item->getId()] = $item->$getter();
         }

         return $array;
     }
public function collectionToArray($collection, $title = 'title')
     {
         $array = array();
         foreach ($collection as $item) {
             $getter = 'get'.ucfirst($title);
             $array[$item->getId()] = $item->$getter();
         }

         return $array;
     }
public function collectionToArray ( $ collection , $ title = 'title' ) { $ array = array ( ) ; foreach ( $ collection as $ item ) { $ getter = 'get' . ucfirst ( $ title ) ; $ array [ $ item -> getId ( ) ] = $ item -> $ getter ( ) ; } return $ array ; }
Transfer collection into array.

@param  [type] $collection [description]
@param  string $title      [description]

@return array              [description]
Transfer collection into array .