예제 #1
0
 protected function buildFrom() {
     $this->_selectBuilder->from->add(Gpf_Db_Table_ActiveViews::getName(), 'av');
     $this->_selectBuilder->from->addLeftJoin(Gpf_Db_Table_Views::getName(), 'v', 'av.'.Gpf_Db_Table_ActiveViews::ACTIVEVIEWID.' = v.'.Gpf_Db_Table_Views::ID);
     $this->_selectBuilder->where->add('av.'.Gpf_Db_Table_ActiveViews::ACCOUNTUSERID, '=', Gpf_Session::getAuthUser()->getUserData()->get(Gpf_Db_Table_Users::ID));
     
     $whereCond = new Gpf_SqlBuilder_CompoundWhereCondition();
     $whereCond->add('v.'.Gpf_Db_Table_Views::ACCOUNTUSERID, '!=', '', 'OR');
     $whereCond->add('av.'.Gpf_Db_Table_ActiveViews::ACTIVEVIEWID, '=', Gpf_View_ViewService::DEFAULT_VIEW_ID, 'OR');
     
     $this->_selectBuilder->where->addCondition($whereCond);
 }