本文整理汇总了PHP中BaseObject::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseObject::getAll方法的具体用法?PHP BaseObject::getAll怎么用?PHP BaseObject::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseObject
的用法示例。
在下文中一共展示了BaseObject::getAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAll
public function getAll()
{
$connections = parent::getAll();
// Explode jcli command output to fetch groups
$exploded = explode("#", $connections);
// Unset first and second elements that include unwanted results from the command group -l
unset($exploded[0]);
unset($exploded[1]);
$connections = [];
foreach ($exploded as $expl) {
$connector = trim($expl);
//fetch string before the "Total Users:" phrase. This has the last user that was parsed from jcli
$ff = strstr($expl, 'Total Users:', true);
if (!empty($ff)) {
$connector = trim($ff);
}
$temp_connector = explode(" ", $connector);
$temp_connector = array_filter($temp_connector);
$fixed_connector = array();
foreach ($temp_connector as $temp) {
array_push($fixed_connector, $temp);
}
$connections[] = ['uid' => $fixed_connector[0], 'gid' => $fixed_connector[1], 'username' => $fixed_connector[2], 'balance' => $fixed_connector[3], 'mt' => $fixed_connector[4], 'throughput' => $fixed_connector[5]];
}
return $connections;
}
示例2: getAll
public function getAll()
{
$connectors = parent::getAll();
// Explode jcli command output to fetch groups
$exploded = explode("#", $connectors);
// Unset first and second elements that include unwanted results from the command group -l
unset($exploded[0]);
unset($exploded[1]);
$connectors = [];
foreach ($exploded as $expl) {
$user = trim($expl);
//fetch string before the "Total Users:" phrase. This has the last user that was parsed from jcli
$ff = strstr($expl, 'Total Users:', true);
if (!empty($ff)) {
$user = trim($ff);
}
$temp_user = explode(" ", $user);
$temp_user = array_filter($temp_user);
$fixed_user = array();
foreach ($temp_user as $temp) {
array_push($fixed_user, $temp);
}
$userz['cid'] = $fixed_user[0];
$userz['status'] = $fixed_user[1];
$userz['session'] = $fixed_user[2];
$userz['starts'] = isset($fixed_user[3]) ? $fixed_user[3] : 0;
$userz['stops'] = isset($fixed_user[4]) ? $fixed_user[4] : 0;
array_push($connectors, $userz);
}
return $connectors;
}
示例3: getAll
public function getAll()
{
$fetch_groups = parent::getAll();
// Explode jcli command output to fetch groups
$exploded = explode("#", $fetch_groups);
// Unset first and second elements that include unwanted results from the command group -l
unset($exploded[0]);
unset($exploded[1]);
$groups = [];
foreach ($exploded as $expl) {
$group = trim($expl);
//fetch string before the "Total Groups:" lectic
$ff = strstr($expl, 'Total Groups:', true);
if (!empty($ff)) {
$group = trim($ff);
}
$groups[] = ['gid' => $group];
}
return $groups;
}