public function mapRelationshipOptions($items, $nameField, $keyField)
    {
        $result = array();

        foreach ($items as $option) {
            $result[] = array(
                'id'   => $option->{$keyField},
                'text' => strval($option->{$nameField}),
            );
        }

        return $result;
    }
public function mapRelationshipOptions($items, $nameField, $keyField)
    {
        $result = array();

        foreach ($items as $option) {
            $result[] = array(
                'id'   => $option->{$keyField},
                'text' => strval($option->{$nameField}),
            );
        }

        return $result;
    }
public function mapRelationshipOptions ( $ items , $ nameField , $ keyField ) { $ result = array ( ) ; foreach ( $ items as $ option ) { $ result [ ] = array ( 'id' => $ option -> { $ keyField } , 'text' => strval ( $ option -> { $ nameField } ) , ) ; } return $ result ; }
Maps the relationship options to an array with 'id' and 'text' keys.

@param array  $items
@param string $nameField
@param string $keyField

@return array
Maps the relationship options to an array with id and text keys .