本文整理汇总了PHP中Nette\Database\Table\Selection::fetchPairs方法的典型用法代码示例。如果您正苦于以下问题:PHP Selection::fetchPairs方法的具体用法?PHP Selection::fetchPairs怎么用?PHP Selection::fetchPairs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Database\Table\Selection
的用法示例。
在下文中一共展示了Selection::fetchPairs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchAll
private function fetchAll(Selection $selection)
{
if ((bool) $this->as_pairs) {
return $selection->fetchPairs($this->pairs[0], $this->pairs[1]);
} else {
return $selection->fetchAll();
}
}
示例2: fetchPairs
/**
* Fetches all rows as associative array.
* @param string|null $key
* @param string|null $value
* @return array
*/
public function fetchPairs($key = null, $value = null)
{
return $this->selection->fetchPairs($key, $value);
}
示例3: fetchPairs
/**
* Fetches all rows as associative array.
*
* @param string $key column name used for an array key or NULL for numeric index
* @param string $value column name used for an array value or NULL for the whole row
*
* @return array
*/
public function fetchPairs($key = NULL, $value = NULL)
{
return $this->selection->fetchPairs($key, $value);
}
示例4: getMenuAdmin
$for_link = $abs_link . ($v->druh->presenter == "Menu" ? "Clanky" : $v->druh->presenter) . ":";
$temp_pol = new \App\FrontModule\Components\Menu\MenuNode();
$temp_pol->name = $ja->nazov;
$temp_pol->tooltip = $ja->h1part2;
$temp_pol->avatar = $v->avatar;
$temp_pol->anotacia = $v->druh->presenter == "Clanky" && isset($ja->clanok_lang->anotacia) ? $ja->clanok_lang->anotacia : FALSE;
$temp_pol->node_class = $v->ikonka !== NULL && strlen($v->ikonka) > 2 ? "fa fa-" . $v->ikonka : NULL;
$temp_pol->link = $v->druh->je_spec_naz ? array($for_link) : $for_link;
$temp_pol->absolutna = $v->absolutna;
$temp_pol->novinka = $v->id_dlzka_novinky > 1 ? $v->modified->add(new \DateInterval('P' . $v->dlzka_novinky->dlzka . 'D')) : NULL;
$temp_pol->id = $v->id;
$temp_pol->poradie_podclankov = $v->poradie_podclankov;
$out[] = array("node" => $temp_pol, "nadradena" => isset($v->id_nadradenej) ? $v->id_nadradenej : -1 * $v->hlavne_menu_cast->id);
unset($temp_pol);
}
return $out;
}
/** Vypis menu pre Admin modul
* @param int $id_reg Min. id registrácie
* @param type $lang_id Id jazyka
* @return array|FALSE
*/
public function getMenuAdmin($id_reg, $lang_id = 1)
{
$polozky = $this->hlavne_menu_lang->where("hlavne_menu.id_registracia <= ?", $id_reg)->where("id_lang", $lang_id)->where("hlavne_menu.druh.modul IS NULL OR hlavne_menu.druh.modul = ?", "Admin")->order('hlavne_menu.id_hlavne_menu_cast, hlavne_menu.uroven, hlavne_menu.poradie ASC');
return $polozky !== FALSE && count($polozky) ? $this->_getMenuAdmin($polozky) : FALSE;
}
/** Vytvorenie menu pre administraciu
* @param Nette\Database\Table\Selection $polozky Vyber poloziek hl. menu
* @return array|FALSE
*/
private function _getMenuAdmin($polozky)
{
$cislo_casti = 0;
//aktualne cislo casti
$casti = array();
$out = array();
foreach ($polozky as $ja) {
$v = $ja->hlavne_menu;
//Mam taku istu cast ako pred tym? Ak nie nastav cislo casti, ale len ak je to dovolene cez $casti
if ($cislo_casti !== $v->id_hlavne_menu_cast) {
//Mam taku istu cast ako pred tym? Ak nie nastav cislo casti
$cislo_casti = $v->id_hlavne_menu_cast;
$casti[] = $cislo_casti;
$temp_pol = new \App\AdminModule\Components\Menu\MenuNode();
$temp_pol->name = $v->hlavne_menu_cast->nazov;
$temp_pol->link = array("Homepage:");
$temp_pol->id = -1 * $v->hlavne_menu_cast->id;
$out[] = array("node" => $temp_pol, "nadradena" => FALSE);