PHP Класс Piwik\DataAccess\LogQueryBuilder\JoinGenerator

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$tables JoinTables

Открытые методы

Метод Описание
__construct ( JoinTables $tables )
generate ( ) : array Generate the join sql based on the needed tables
getJoinString ( )
shouldJoinWithSelect ( )
sortTablesForJoin ( $tA, $tB )

Защищенные методы

Метод Описание
findJoinCriteriasForTables ( Piwik\Tracker\LogTable $logTable, Piwik\Tracker\LogTable[] $availableLogTables ) : string | null
generateNonVisitJoins ( $tableName, $tableNameToJoin, $index ) This code is a bit tricky. We have to execute this right at the beginning before actually iterating over all the tables and generating the join string as we may have to delete a table from the tables. If we did not delete this table upfront, we would have maybe already added a joinString for that table, even though it will be later removed by another table. This means if we wouldn't delete/unset that table upfront, we would need to alter an already generated join string which would not be really nice code as well.

Приватные методы

Метод Описание
addMissingTablesNeededForJoins ( )

Описание методов

__construct() публичный Метод

public __construct ( JoinTables $tables )
$tables JoinTables

findJoinCriteriasForTables() защищенный Метод

protected findJoinCriteriasForTables ( Piwik\Tracker\LogTable $logTable, Piwik\Tracker\LogTable[] $availableLogTables ) : string | null
$logTable Piwik\Tracker\LogTable
$availableLogTables Piwik\Tracker\LogTable[]
Результат string | null returns null in case the table is already joined, or the join string if the table needs to be joined

generate() публичный Метод

Generate the join sql based on the needed tables
public generate ( ) : array
Результат array

generateNonVisitJoins() защищенный Метод

Next problem is, because we are deleting a table, we have to remember the "joinOn" string for that table in a property "nonVisitJoins". Otherwise we would not be able to generate the correct "joinOn" string when actually iterating over all the tables to generate that string.
protected generateNonVisitJoins ( $tableName, $tableNameToJoin, $index )
$tableName
$tableNameToJoin
$index

getJoinString() публичный Метод

public getJoinString ( )

shouldJoinWithSelect() публичный Метод

sortTablesForJoin() публичный Метод

public sortTablesForJoin ( $tA, $tB )

Описание свойств

$tables защищенное свойство

protected JoinTables,Piwik\DataAccess\LogQueryBuilder $tables
Результат JoinTables