public function replacePrefix($sql, $prefix = '#__')
	{
		// As we replace strings of different lengths, subsequent prefix positions will become invalid.
		// Thus, we track that differential here to account for the shifting locations
		$differential = strlen($this->tablePrefix) - strlen($prefix);
		$count        = 0;

		foreach (Str::findLiteral($prefix, $sql) as $prefixPosition)
		{
			$sql = substr_replace($sql, $this->tablePrefix, $prefixPosition + ($differential*$count), strlen($prefix));
			$count++;
		}

		return $sql;
	}
public function replacePrefix($sql, $prefix = '#__')
	{
		// As we replace strings of different lengths, subsequent prefix positions will become invalid.
		// Thus, we track that differential here to account for the shifting locations
		$differential = strlen($this->tablePrefix) - strlen($prefix);
		$count        = 0;

		foreach (Str::findLiteral($prefix, $sql) as $prefixPosition)
		{
			$sql = substr_replace($sql, $this->tablePrefix, $prefixPosition + ($differential*$count), strlen($prefix));
			$count++;
		}

		return $sql;
	}
public function replacePrefix ( $ sql , $ prefix = '#__' ) { // As we replace strings of different lengths, subsequent prefix positions will become invalid. // Thus, we track that differential here to account for the shifting locations $ differential = strlen ( $ this -> tablePrefix ) - strlen ( $ prefix ) ; $ count = 0 ; foreach ( Str :: findLiteral ( $ prefix , $ sql ) as $ prefixPosition ) { $ sql = substr_replace ( $ sql , $ this -> tablePrefix , $ prefixPosition + ( $ differential * $ count ) , strlen ( $ prefix ) ) ; $ count ++ ; } return $ sql ; }
Replaces a string placeholder with the string held in the class variable

@param   string  $sql     The SQL statement to prepare
@param   string  $prefix  The common table prefix
@return  string
@since   2.0.0
Replaces a string placeholder with the string held in the class variable