public static function generateImageName($baseName)
    {
        $fileName = hash('crc32', $baseName . time());
        if (file_exists(Yii::getAlias('@frontend/web/images/shop/' . $fileName . '-original.jpg'))) {
            return static::generateImageName($baseName);
        }
        return $fileName;
    }
public static function generateImageName($baseName)
    {
        $fileName = hash('crc32', $baseName . time());
        if (file_exists(Yii::getAlias('@frontend/web/images/shop/' . $fileName . '-original.jpg'))) {
            return static::generateImageName($baseName);
        }
        return $fileName;
    }
public static function generateImageName ( $ baseName ) { $ fileName = hash ( 'crc32' , $ baseName . time ( ) ) ; if ( file_exists ( Yii :: getAlias ( '@frontend/web/images/shop/' . $ fileName . '-original.jpg' ) ) ) { return static :: generateImageName ( $ baseName ) ; } return $ fileName ; }
Generates unique name by string.
@param $baseName
@return string
Generates unique name by string .