/** * 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; }
public static function availableProperties() { $properties = Self::all(); $result = []; foreach ($properties as $property) { $result[$property->id] = $property->description; } return $result; }
/** * */ 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; }
/** * 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; }
function getAll() { $query = Self::all(); return $query->toArray(); }
public function allBlogs() { return Self::all()->toArray(); }
public static function getData() { $results = Self::all(); return $results; }