src/Drivers/AbstractDriver.php
public function prefixTable(string $table): string
	{
		// Add the prefix to the table name
		// before quoting it
		if ( ! empty($this->tablePrefix))
		{
			// Split identifier by period, will split into:
			// database.schema.table OR
			// schema.table OR
			// database.table OR
			// table
			$identifiers = explode('.', $table);
			$segments = count($identifiers);

			// Quote the last item, and add the database prefix
			$identifiers[$segments - 1] = $this->_prefix(end($identifiers));

			// Rejoin
			$table = implode('.', $identifiers);
		}

		return $table;
	}
public function prefixTable(string $table): string
	{
		// Add the prefix to the table name
		// before quoting it
		if ( ! empty($this->tablePrefix))
		{
			// Split identifier by period, will split into:
			// database.schema.table OR
			// schema.table OR
			// database.table OR
			// table
			$identifiers = explode('.', $table);
			$segments = count($identifiers);

			// Quote the last item, and add the database prefix
			$identifiers[$segments - 1] = $this->_prefix(end($identifiers));

			// Rejoin
			$table = implode('.', $identifiers);
		}

		return $table;
	}
public function prefixTable ( string $ table ) : string { // Add the prefix to the table name // before quoting it if ( ! empty ( $ this -> tablePrefix ) ) { // Split identifier by period, will split into: // database.schema.table OR // schema.table OR // database.table OR // table $ identifiers = explode ( '.' , $ table ) ; $ segments = count ( $ identifiers ) ; // Quote the last item, and add the database prefix $ identifiers [ $ segments - 1 ] = $ this -> _prefix ( end ( $ identifiers ) ) ; // Rejoin $ table = implode ( '.' , $ identifiers ) ; } return $ table ; }
Prefixes a table if it is not already prefixed
@param string $table
@return string
Prefixes a table if it is not already prefixed