Piwik\DataAccess\LogAggregator::setQueryOriginHint PHP Method

setQueryOriginHint() public method

public setQueryOriginHint ( $nameOfOrigiin )
    public function setQueryOriginHint($nameOfOrigiin)
    {
        $this->queryOriginHint = $nameOfOrigiin;
    }

Usage Example

Example #1
0
    public function test_generateQuery_WithQueryHint_ShouldAddQueryHintAsComment()
    {
        $this->logAggregator->setQueryOriginHint('MyPluginName');
        $query = $this->logAggregator->generateQuery('test, test2', 'log_visit', '1=1', false, '5');
        $expected = array('sql' => 'SELECT /* MyPluginName */
				test, test2
			FROM
				log_visit AS log_visit
			WHERE
				1=1
			ORDER BY
				5', 'bind' => array(0 => '2012-01-01 00:00:00', 1 => '2012-01-31 23:59:59', 2 => 1));
        $this->assertSame($expected, $query);
    }
All Usage Examples Of Piwik\DataAccess\LogAggregator::setQueryOriginHint