addTableToJoin() public method

public addTableToJoin ( $tableName )
コード例 #1
0
ファイル: JoinTablesTest.php プロジェクト: diosmosis/piwik
 /**
  * @expectedException \Exception
  * @expectedExceptionMessage Table 'log_foo_bar_baz' can't be used for segmentation
  */
 public function test_addTableToJoin_shouldCheckIfTableCanBeUsedForSegmentation()
 {
     $table = 'log_foo_bar_baz';
     $this->assertFalse($this->tables->hasJoinedTable($table));
     $this->tables->addTableToJoin($table);
     $this->assertTrue($this->tables->hasJoinedTable($table));
 }
コード例 #2
0
ファイル: JoinGenerator.php プロジェクト: diosmosis/piwik
 private function addMissingTablesNeededForJoins()
 {
     foreach ($this->tables as $index => $table) {
         if (is_array($table)) {
             continue;
         }
         $logTable = $this->tables->getLogTable($table);
         if (!$logTable->getColumnToJoinOnIdVisit()) {
             $tableNameToJoin = $logTable->getLinkTableToBeAbleToJoinOnVisit();
             if ($index > 0 && !$this->tables->hasJoinedTable($tableNameToJoin)) {
                 $this->tables->addTableToJoin($tableNameToJoin);
             }
             if ($this->tables->hasJoinedTable($tableNameToJoin)) {
                 $this->generateNonVisitJoins($table, $tableNameToJoin, $index);
             }
         }
     }
 }