Files
Thunderforge 285c759717 WEB: Adding null check before string replacement (#209)
Fixes errors such as

```
PHP Deprecated:  strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/Will/OpenSource/scummvm-web/include/Objects/File.php on line 26
```
2022-02-23 20:27:44 -06:00

29 lines
811 B
PHP

<?php
namespace ScummVM\OrmObjects;
use ScummVM\OrmObjects\Base\Download as BaseDownload;
/**
* Skeleton subclass for representing a row from the 'scummvm_downloads' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*/
class Download extends BaseDownload
{
public function getName()
{
$name = parent::getName();
$version = $this->getVersion();
// If it's not the latest version and not daily, prefix with the version number
if ($version != null && $version != RELEASE && $version != 'Daily') {
return str_replace('{$version}', $version, "$version $name");
}
return $name;
}
}