public static function getLanguageItems(array $fields)
    {
        $items = [];

        foreach ($fields as $field) {
            foreach ($field->getLabels() as $label) {
                if (!$label->isPlain) {
                    $items[$label->lang][] = $label;
                }
            }

            foreach ($field->getPlaceholders() as $label) {
                if (!$label->isPlain) {
                    $items[$label->lang][] = $label;
                }
            }

            foreach ($field->getOptions() as $lang => $labels) {
                foreach ($labels as $label) {
                    if (!$label->isPlain) {
                        $items[$label->lang][] = $label;
                    }
                }
            }
        }

        return $items;
    }
public static function getLanguageItems(array $fields)
    {
        $items = [];

        foreach ($fields as $field) {
            foreach ($field->getLabels() as $label) {
                if (!$label->isPlain) {
                    $items[$label->lang][] = $label;
                }
            }

            foreach ($field->getPlaceholders() as $label) {
                if (!$label->isPlain) {
                    $items[$label->lang][] = $label;
                }
            }

            foreach ($field->getOptions() as $lang => $labels) {
                foreach ($labels as $label) {
                    if (!$label->isPlain) {
                        $items[$label->lang][] = $label;
                    }
                }
            }
        }

        return $items;
    }
public static function getLanguageItems ( array $ fields ) { $ items = [ ] ; foreach ( $ fields as $ field ) { foreach ( $ field -> getLabels ( ) as $ label ) { if ( ! $ label -> isPlain ) { $ items [ $ label -> lang ] [ ] = $ label ; } } foreach ( $ field -> getPlaceholders ( ) as $ label ) { if ( ! $ label -> isPlain ) { $ items [ $ label -> lang ] [ ] = $ label ; } } foreach ( $ field -> getOptions ( ) as $ lang => $ labels ) { foreach ( $ labels as $ label ) { if ( ! $ label -> isPlain ) { $ items [ $ label -> lang ] [ ] = $ label ; } } } } return $ items ; }
Creates a colection of messages out of a given fields collection.

@param array $fields

@return array
Creates a colection of messages out of a given fields collection .