Returns the Source object for the given source name

@param string $sourceName the source name

@return null|SourceInterface
327630
public function getSourceByName($sourceName)
    {
        if (isset($this->sources[$sourceName])) {
            return $this->sources[$sourceName];
        }
        return null;
    }
1186209
public function get_file_source_info($source) {
        $ref = json_decode(base64_decode($source));
        $filename  = clean_param($ref->filename, PARAM_FILE);
        return 'EQUELLA: ' . $filename;
    }
420103
private function getSourceLines($filename)
    {
        $rawSource = file_get_contents($filename);

        $source = explode(PHP_EOL, $rawSource);

        if (count($source) === 1) {
            if (substr_count($rawSource, "\n") > substr_count($rawSource, "\r")) {
                $source = explode("\n", $rawSource);
            } else {
                $source = explode("\r", $rawSource);
            }
        }

        $source = str_replace(array("\n", "\t", "\r"), '', $source);

        return $source;
    }
811276
public static function parseFile($filename) {
    $source = @file_get_contents($filename);
    if ($source === FALSE) {
      return FALSE;
    }
    return self::parseSource($source, $filename);
  }
121758
public function get($source)
    {
        $path = realpath($source);
        $path = (is_null($path)) ? '' : $path;

        $result = $this->sources->get($path);

        if ($result->isEmpty()) {
            return null;
        }

        return $result->get();
    }
458695
public function findAndUpdate($source)
    {
        /** @var Redirect|null $redirect */
        $redirect = $this->om->getRepository($this->class)->findOneBy(array('source' => $source));

        if (null === $redirect) {
            return null;
        }

        $redirect->increaseCount();
        $redirect->updateLastAccessed();
        $this->om->flush();

        return $redirect;
    }
1329807
protected function checkSource($source)
    {
        /** @var array */
        $sources = $this->registry->get('source', []);
        $result  = in_array($source, $sources) || in_array('*', $sources);

        return $result;
    }
1054643
private function resolveObject($source, array $args, string $fieldName)
    {
        $getter = $this->getGetter($source, $fieldName);
        if ($getter) {
            $args = $this->orderArguments($getter, $args);

            return $getter->invoke($source, ...$args);
        }

        if (isset($source->{$fieldName})) {
            return $source->{$fieldName};
        }

        return null;
    }
562388
private function coalesceSources($source = null)
    {
        if (isset($source)) {
            return $source;
        } elseif (isset($this->source)) {
            return $this->source;
        }

        return $_SERVER;
    }
1366758
public function main($sourceFileName)
    {
        if ($this->handleDirSep) {
            if (strpos('\\', $sourceFileName) !== false) {
                $sourceFileName = str_replace('\\', '/', $sourceFileName);
            }
        }
        if ($this->reg === null || $this->to === null || !$this->reg->matches((string) $sourceFileName)) {
            return null;
        }

        return [$this->replaceReferences($sourceFileName)];
    }
13961
protected function getSourceAsArray($source)
    {
        if (!is_array($source) && !($source instanceof ArrayAccess)) {
            user_error('$source passed in as invalid type', E_USER_ERROR);
        }
        
        if ($source instanceof SS_List || $source instanceof Map) {
            $source = $source->toArray();
        }
        
        return $source;
    }
814257
public function getDataSource(string  $source) : Source
	{
		switch ($source) {
			case 'form':
			case 'forms':
				return $this
					->getDataSources()
					->getFormsDataSource();
				break;
			case 'entry':
			case 'entries':
				return $this
					->getDataSources()
					->getEntryDataSource();
				break;
			case 'entryValue':
			case 'entryValues':
				return $this
					->getDataSources()
					->getEntryValuesDataSource();
		}
	}
248912
public function getSourceAdapter($name)
    {
        foreach (array_reverse($this->sourceAdapters) as $pattern => $adapter) {
            if (preg_match($pattern, $name)) {
                return $adapter;
            }
        }

        return null;
    }
1137864
public function getType($name)
    {
        if (isset($this->types[$name])) {
            return $this->types[$name];
        }

        throw new SourceTypeException(sprintf('Mapper source type %s not found!', $name));
    }
217830
public function getRepository($repositoryName)
    {
        $repositoryName = (string)$repositoryName;
        if(!isset($this->config['repositories'][$repositoryName]['class'])) return false;
        $className = $this->config['repositories'][$repositoryName]['class'];
        if (!class_exists($className)) {
            return false;
        }
        $connectionName = isset($this->config['repositories'][$repositoryName]['connection'])?$this->config['repositories'][$repositoryName]['connection']:null;
        return new $className($connectionName);
    }
797962
protected function getReferenceSource(Model $model, $source = null)
    {
        if (null === $source) {
            // Get model information for the model
            $information = $this->getInformationRepository()->getByModel($model);

            if ($information && $information->reference->source) {
                $source = $information->reference->source;
            }
        }

        if ( ! $source) return null;

        return $source;
    }
640722
public function getMainFromSource(int $sourceId): int
    {
        if (!array_key_exists($sourceId, $this->sourceMap)) {
            throw new \RuntimeException('Not mapped');
        }
        return $this->sourceMap[$sourceId];
    }