private function initVisitsWhere(Gpf_SqlBuilder_WhereClause $where) { $visitorCondition = new Gpf_SqlBuilder_CompoundWhereCondition(); $visitorCondition->add(Pap_Db_Table_Visits::VISITORID, '=', $this->visitorId); if ($this->ip != '') { $visitorCondition->add(Pap_Db_Table_Visits::IP, '=', $this->ip, 'OR'); } $where->addCondition($visitorCondition); $accountCondition = new Gpf_SqlBuilder_CompoundWhereCondition(); $accountCondition->add(Pap_Db_Table_Visits::ACCOUNTID, '=', $this->accountId); if ($this->accountId == Gpf_Db_Account::DEFAULT_ACCOUNT_ID) { $accountCondition->add(Pap_Db_Table_Visits::ACCOUNTID, '=', '', 'OR'); } $where->addCondition($accountCondition); $where->add(Pap_Db_Table_Visits::DATEVISIT, '<=', $this->toDate->toDateTime()); }
private function addArrayNegativeConditionTo(Gpf_SqlBuilder_WhereClause $whereClause) { $condition = new Gpf_SqlBuilder_CompoundWhereCondition(); foreach ($this->decodeArrayValue() as $value) { $condition->add($this->getCode(), '!=', $value, 'AND', $this->operator->getDoQuote()); } $whereClause->addCondition($condition); }