本文整理汇总了PHP中Clients::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Clients::find方法的具体用法?PHP Clients::find怎么用?PHP Clients::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Clients
的用法示例。
在下文中一共展示了Clients::find方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCalendarResources
public function getCalendarResources($connection, $group)
{
$personnel = new Personnel();
$clients = new Clients();
$personnel_list = $personnel->find(null, $connection);
$client_list = $clients->find(null, $connection);
$resources = [];
switch ($group) {
case 'Client':
foreach ($client_list as $clientRecord) {
foreach ($personnel_list as $personnelRecord) {
$r = [];
$r["id"] = $personnelRecord["id"];
$r["clientName"] = $clientRecord["name"];
$r["title"] = $personnelRecord["name"];
$resources[] = $r;
}
}
break;
default:
foreach ($personnel_list as $personnelRecord) {
foreach ($client_list as $clientRecord) {
$r = [];
$r["id"] = $clientRecord["id"];
$r["personnelName"] = $personnelRecord["name"];
$r["title"] = $clientRecord["name"];
$resources[] = $r;
}
}
break;
}
$resources = json_encode($resources);
return $resources;
}