本文整理汇总了PHP中Self::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Self::all方法的具体用法?PHP Self::all怎么用?PHP Self::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Self
的用法示例。
在下文中一共展示了Self::all方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: availableTenants
/**
* Show a list of all available tenants
* @return [array] list of tenants
*/
public static function availableTenants()
{
$tenants = Self::all();
$result = [];
foreach ($tenants as $tenant) {
$result[$tenant->id] = $tenant->name;
}
return $result;
}
示例2: availableProperties
public static function availableProperties()
{
$properties = Self::all();
$result = [];
foreach ($properties as $property) {
$result[$property->id] = $property->description;
}
return $result;
}
示例3: readAll
/**
*
*/
public static function readAll()
{
$results = Self::all();
#formatting the result to json
$arrData = array();
foreach ($results as $result) {
$arrData['data'][] = array('id' => $result->id, 'name' => $result->option);
}
return $arrData;
}
示例4: getAll
/**
* return all online players as an array
*
* @return array
*/
public static function getAll($extra = null)
{
$rows = Self::all();
if ($rows->count() == 0) {
return false;
}
$return = collect([]);
foreach ($rows as $row) {
$char = \distro\tfs10\Character::find(playerIdToName($row['player_id']));
$item = collect(['name' => $char->getName(), 'vocation' => $char->getVocation(), 'level' => $char->getLevel()]);
if (!is_null($extra)) {
foreach ($extra as $key) {
$item->put($key, $char->{$key});
}
}
$return->push($item->all());
}
return $return;
}
示例5: getAll
function getAll()
{
$query = Self::all();
return $query->toArray();
}
示例6: allBlogs
public function allBlogs()
{
return Self::all()->toArray();
}
示例7: getData
public static function getData()
{
$results = Self::all();
return $results;
}