本文整理汇总了PHP中CService::loadList方法的典型用法代码示例。如果您正苦于以下问题:PHP CService::loadList方法的具体用法?PHP CService::loadList怎么用?PHP CService::loadList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CService
的用法示例。
在下文中一共展示了CService::loadList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getAllConfigs
protected static function _getAllConfigs($class, $key, $value)
{
// Chargement des etablissements
$group = new CGroups();
/** @var CGroups[] $groups */
$groups = $group->loadList();
// Chargement des services
$service = new CService();
$services = $service->loadList();
// Chargement de toutes les configs
/** @var self $config */
$config = new $class();
/** @var self[] $all_configs */
$all_configs = $config->loadList();
if ($all_configs == null) {
return null;
}
/** @var self[] $configs_default */
// Creation du tableau de valeur par defaut (quelque soit l'etablissement)
foreach ($all_configs as $_config) {
if (!$_config->service_id && !$_config->group_id) {
$configs_default[$_config->{$key}] = $_config;
} else {
if ($_config->service_id) {
$configs_service[$_config->service_id][$_config->{$key}] = $_config->{$value};
} else {
$configs_group[$_config->group_id][$_config->{$key}] = $_config->{$value};
}
}
}
$configs = array();
// Parcours des etablissements
foreach ($groups as $group_id => $group) {
$group->loadRefsServices();
// Parcours des services
foreach ($group->_ref_services as $service_id => $_service) {
foreach ($configs_default as $_config_default) {
$configs[$group_id][$service_id][$_config_default->{$key}] = $_config_default->{$value};
if (isset($configs_group[$group_id][$_config_default->{$key}])) {
$configs[$group_id][$service_id][$_config_default->{$key}] = $configs_group[$group_id][$_config_default->{$key}];
}
if (isset($configs_service[$service_id][$_config_default->{$key}])) {
$configs[$group_id][$service_id][$_config_default->{$key}] = $configs_service[$service_id][$_config_default->{$key}];
}
}
}
// Si aucun service
foreach ($configs_default as $_config_default) {
if (isset($configs_group[$group_id][$_config_default->{$key}])) {
$configs[$group_id]["none"][$_config_default->{$key}] = $configs_group[$group_id][$_config_default->{$key}];
} else {
$configs[$group_id]["none"][$_config_default->{$key}] = $_config_default->{$value};
}
}
}
return $configs;
}
示例2: array
*/
$services_ids = CValue::getOrSession("services_ids", array());
$services_ids_suggest = CValue::get("services_ids_suggest", null);
$view = CValue::get("view");
$ajax_request = CValue::get("ajax_request", 1);
if (!is_array($services_ids_suggest) && !is_null($services_ids_suggest)) {
$services_ids = explode(",", $services_ids_suggest);
}
$group_id = CGroups::loadCurrent()->_id;
$where = array();
$where["group_id"] = "= '{$group_id}'";
$where["cancelled"] = "= '0'";
$where["secteur_id"] = "IS NULL";
$order = "externe, nom";
$service = new CService();
$all_services = $service->loadList($where, $order);
unset($where["secteur_id"]);
$services_allowed = $service->loadListWithPerms(PERM_READ, $where, $order);
$where = array();
$where["group_id"] = "= '{$group_id}'";
$secteur = new CSecteur();
$secteurs = $secteur->loadList($where, "nom");
foreach ($secteurs as $_secteur) {
$_secteur->loadRefsServices();
$keys2 = array_keys($_secteur->_ref_services);
$_secteur->_all_checked = count($_secteur->_ref_services) > 0 ? array_values(array_intersect($services_ids, $keys2)) == $keys2 : false;
}
$services_ids_hospi = CAppUI::pref("services_ids_hospi");
if (!$services_ids_hospi) {
$services_ids_hospi = "{}";
}
示例3: CSejour
<?php
/**
* $Id$
*
* @category Admissions
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
* @link http://www.mediboard.org
*/
CCanDo::checkRead();
// Chargement du séjour s'il y en a un
$sejour = new CSejour();
$sejour->load(CValue::get("sejour_id"));
$service_id = $sejour->service_sortie_id;
$service = new CService();
$service->load($service_id);
// Chargement des services
$order = "nom";
$services = $service->loadList(null, $order);
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("service", $service);
$smarty->assign("services", $services);
$smarty->display("inc_vw_services.tpl");