本文整理匯總了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;
}