本文整理匯總了PHP中Constants::getListKey方法的典型用法代碼示例。如果您正苦於以下問題:PHP Constants::getListKey方法的具體用法?PHP Constants::getListKey怎麽用?PHP Constants::getListKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Constants
的用法示例。
在下文中一共展示了Constants::getListKey方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: update
public function update($table, $value, $id)
{
$message = $this->validationForm($table, $value);
if ($message['error'] === 1) {
$message['error'] = '<span class="alert alert-danger">Something is wrong!</span>';
return $message;
}
$listkey = Constants::getListKey()[$table];
if (!empty($this->listToAdd($listkey, $value))) {
$listToAdd = $this->listToAdd($listkey, $value);
} else {
return '<span class="alert alert-danger">Something is wrong</span>';
}
if ($this->model->update($table, $listToAdd, "id=" . $id)) {
if (isset($_SESSION['data'])) {
unset($_SESSION['data']);
}
return 1;
}
}
示例2: define
<?php
require_once "../model/session.php";
require_once '../model/models.php';
define('LIMIT', 500);
$controllerCalled = 1;
$_SESSION['page'] = "report";
$report = new Model();
$tours = new Tours();
$list = $report->_list("tours", "*");
$listTours = $tours->_list("tours", "*");
// La liste des titres des colonnes de la table tours.
$toursKeys = Constants::getListKey()['tours'];
//la taille du tableau tours dans la base
$size = sizeof($list);
//On divise le table par 500 pour ne pas afficher tout les donnees.
$div = $size > LIMIT ? $size / LIMIT : 1;
$limit = LIMIT;
for ($i = 0; $i < sizeof($list); $i++) {
foreach ($list[$i] as $key => $value) {
if ($key == "guardtours_id") {
$guardtours_id = $list[$i][$key];
$guard_id = $report->getBy("guardtours", "guard_id", "id", $guardtours_id);
$nom = $report->getBy("guard", "nom", "id", $guard_id);
$prenom = $report->getBy("guard", "prenom", "id", $guard_id);
$list[$i][$key] = $nom . " " . $prenom;
}
}
}
// $mention = $tours->getMention("09:00:00", 1);
include "../vue/report.php";