doctrine join ã㦠sfDocetinePager 使ãã¨å¤§éã«SQLã¯ããã
$this->hasMany('ATable', array('local' => 'a_table_id', 'foreign' => 'id')); $q = $this->createQuery() ->select('self.id as id') ->from($this->_options['name'] . ' self') ->leftJoin('self.ATable at'); $pager = new sfDoctrinePager($this->_options['name'], $limit); $pager->setQuery($q); $pager->setPage($page); $pager->init();
ã£ã¦ãã£ãã¨ãã«ããã§åå¾ããã¬ã³ã¼ãã foreach ã§åãã¨1ã¬ã³ã¼ããã¨ã«1SQLçºè¡ãã¡ããã
$this->hasMany('ATable', array('local' => 'a_table_id', 'foreign' => 'id')); $q = $this->createQuery() ->select('self.id as id, at.id as at_id') ->from($this->_options['name'] . ' self') ->leftJoin('self.ATable at'); $pager = new sfDoctrinePager($this->_options['name'], $limit); $pager->setQuery($q); $pager->setPage($page); $pager->init();
ã®ããã«ãã¦joinãã¦ããã¼ãã«ã®ä¸»ãã¼ï¼ä»åã®å ´åã¯at.id)ãæ示çã«selectããã¨è§£æ±ºã
ãªãã§ãããã