original_string: public function createFlatArrayWithValuesAsAttributeName($attribute_name)
      {
          $a = [];
          foreach ($this->getCollection() as $key => $object) {
              $object_array = $object->toArray();
              if (isset($object_array[$attribute_name])) {
                  $a[$key] = $object_array[$attribute_name];
              }
          }
          return $a;
      }
code: public function createFlatArrayWithValuesAsAttributeName($attribute_name)
      {
          $a = [];
          foreach ($this->getCollection() as $key => $object) {
              $object_array = $object->toArray();
              if (isset($object_array[$attribute_name])) {
                  $a[$key] = $object_array[$attribute_name];
              }
          }
          return $a;
      }
code_tokens: public function createFlatArrayWithValuesAsAttributeName ( $ attribute_name ) { $ a = [ ] ; foreach ( $ this -> getCollection ( ) as $ key => $ object ) { $ object_array = $ object -> toArray ( ) ; if ( isset ( $ object_array [ $ attribute_name ] ) ) { $ a [ $ key ] = $ object_array [ $ attribute_name ] ; } } return $ a ; }
docstring: solutions for reducing Collection just to one attribute - flat array
  
  @param $attribute_name
  @return array
docstring_tokens: solutions for reducing Collection just to one attribute - flat array