public function getSources(string $fieldType, $sources, string $indexFrom, string $indexTo)
    {
        $mappedSources = $sources;
        if (is_array($sources)) {
            $mappedSources = [];
            $sources = array_filter($sources);
            foreach ($sources as $source) {
                $mappedSources[] = $this->getSource($fieldType, $source, $indexFrom, $indexTo);
            }
        }

        return $mappedSources;
    }
public function getSources(string $fieldType, $sources, string $indexFrom, string $indexTo)
    {
        $mappedSources = $sources;
        if (is_array($sources)) {
            $mappedSources = [];
            $sources = array_filter($sources);
            foreach ($sources as $source) {
                $mappedSources[] = $this->getSource($fieldType, $source, $indexFrom, $indexTo);
            }
        }

        return $mappedSources;
    }
public function getSources ( string $ fieldType , $ sources , string $ indexFrom , string $ indexTo ) { $ mappedSources = $ sources ; if ( is_array ( $ sources ) ) { $ mappedSources = [ ] ; $ sources = array_filter ( $ sources ) ; foreach ( $ sources as $ source ) { $ mappedSources [ ] = $ this -> getSource ( $ fieldType , $ source , $ indexFrom , $ indexTo ) ; } } return $ mappedSources ; }
Get sources based on the indexFrom attribute and return them with the indexTo attribute.

@param string       $fieldType
@param string|array $sources
@param string       $indexFrom
@param string       $indexTo

@return array|string
Get sources based on the indexFrom attribute and return them with the indexTo attribute .