private function buildLabels($labels)
    {
        $collection = [];
        foreach ($labels as $label) {
            $collection[] = Label::createFromData($label);
        }

        return $collection;
    }
private function buildLabels($labels)
    {
        $collection = [];
        foreach ($labels as $label) {
            $collection[] = Label::createFromData($label);
        }

        return $collection;
    }
private function buildLabels ( $ labels ) { $ collection = [ ] ; foreach ( $ labels as $ label ) { $ collection [ ] = Label :: createFromData ( $ label ) ; } return $ collection ; }
Set the Label collection from an array.

@param array $labels an array of labels

@return Label[] the collection of labels
Set the Label collection from an array .