本文整理汇总了PHP中Service::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Service::all方法的具体用法?PHP Service::all怎么用?PHP Service::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Service
的用法示例。
在下文中一共展示了Service::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$project = Project::find($id);
$services = Service::all();
$clients = Client::all();
return View::make('projects.edit')->withProject($project)->withService($services)->withClients($clients);
/*return $clients;*/
}
示例2: editPet
public function editPet(Pet $pet)
{
$allServices = Service::all();
$services = array();
foreach ($allServices as $service) {
$services[$service->id] = $service->name;
}
return View::make('edit_pet', compact('pet', 'services'));
}
示例3: scopeGetList
public function scopeGetList()
{
$services = Service::all();
$data = array();
foreach ($services as $service) {
$data[$service->id] = $service->name;
}
return $data;
}
示例4: getEndpointsAndServices
public function getEndpointsAndServices()
{
$services = Service::all()->toArray();
$endpoints = EndPoint::all();
$computedEndpoints = array();
foreach ($endpoints as $endpoint) {
$computedEndpoint = static::GetComputedEndpoint($endpoint);
array_push($computedEndpoints, (object) $computedEndpoint);
}
return Response::json(array("success" => true, "services" => $services, "endpoints" => $computedEndpoints));
}
示例5: index
public static function index()
{
$user = BaseController::get_user_logged_in();
$services = array();
$deleted_services = null;
if ($user->manager) {
$services = Service::all();
$deleted_services = Service::all_deleted();
} else {
$services = Service::all_for_user($user->id);
}
View::make('service/index.html', array('services' => $services, 'deleted_services' => $deleted_services));
}
示例6: run
public function run()
{
$event = Ssms\Event::create(['name' => 'user.add', 'description' => 'When a new user is added']);
$this->attach($event, Service::whereName('hipchat')->get());
$event = Ssms\Event::create(['name' => 'user.delete', 'description' => 'When a user is deleted']);
$this->attach($event, Service::whereName('hipchat')->get());
$event = Ssms\Event::create(['name' => 'server.up', 'description' => 'When a server is back up after being down']);
$this->attach($event, Service::all());
$event = Ssms\Event::create(['name' => 'server.down', 'description' => 'When a server is down (retry threshold breached)']);
$this->attach($event, Service::all());
$event = Ssms\Event::create(['name' => 'server.updating', 'description' => 'When a server is updating']);
$this->attach($event, Service::where('name', 'email')->orWhere('name', 'hipchat')->get());
$event = Ssms\Event::create(['name' => 'server.restart', 'description' => 'When a server is restarting']);
$this->attach($event, Service::whereName('hipchat')->get());
}
示例7: sandbox
public static function sandbox()
{
$service = Service::find(1);
$services = Service::all();
$employees = Employee::all();
$employee = Employee::find(1);
$service2 = new Service(array('name' => 'aasdd', 'price' => "2", 'description' => "asfafaf"));
$errors = $service2->errors();
Kint::dump($employee);
Kint::dump($employees);
Kint::dump($service);
Kint::dump($services);
Kint::dump($errors);
// View::make('helloworld.html');
}
示例8: vendor
public static function vendor()
{
$faker = Faker\Factory::create();
$image_urls = array('http://i.imgur.com/Gh4ZX.png', 'http://i.imgur.com/vySFV.png', 'http://i.imgur.com/RdBae.png', 'http://i.imgur.com/ED5fa.png', 'http://i.imgur.com/gJncN.png', 'http://i.imgur.com/3pKFS.png', 'http://i.imgur.com/3pKFS.png');
$u = User::create(array('email' => 'vendor' . self::$vendor_count . '@example.com', 'password' => 'password'));
$v = new Vendor(array('company_name' => $faker->company, 'contact_name' => $faker->name, 'address' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->stateAbbr, 'zip' => $faker->postcode, 'ballpark_price' => rand(1, 4), 'image_url' => $image_urls[array_rand($image_urls)], 'homepage_url' => $faker->url, 'more_info' => $faker->paragraph));
$v->user_id = $u->id;
$v->save();
foreach (Service::all() as $service) {
if (rand(1, 2) == 2) {
$v->services()->attach($service->id);
}
}
self::$vendor_count++;
return $v;
}
示例9: getServiceResult
private static function getServiceResult($text)
{
$services = Service::all();
$endpointsResult = array();
foreach ($services as $service) {
$call_no = 0;
$endpoints = $service->endpoints()->get();
foreach ($endpoints as $ep) {
array_push($endpointsResult, $ep->call($text));
$call_no++;
}
$limit = Limit::where('service_id', '=', $service->id)->first();
$limit->current_hits = $limit->current_hits + $call_no;
$limit->save();
}
return $endpointsResult;
}
示例10: edit_user
public static function edit_user($id)
{
$user = User::find($id);
if ($user != null) {
$services = array();
$all_services = Service::all();
foreach ($all_services as $service) {
$services[$service->id] = array('service' => $service, 'available' => false);
}
$user_services = Service::all_for_user($id);
foreach ($user_services as $service) {
$services[$service->id]['available'] = true;
}
View::make('useradmin/edit_user.html', array('user' => $user, 'services' => $services));
} else {
Redirect::to(\Slim\Slim::getInstance()->urlFor('users_index'), array('message' => 'Käyttäjää ei löytynyt!', 'error' => true));
}
}
示例11: getServices
public function getServices()
{
//internal service for AJAX status
$response = array();
$services = Service::all();
foreach ($services as $service) {
$endpoints = $service->endpoints()->get();
$limit = $service->limits()->first();
$eps = array();
foreach ($endpoints as $ep) {
$epArr = $ep->toArray();
$epArr['paramerters'] = $ep->parameters->toArray();
$eps[] = $epArr;
}
$response[] = array('name' => $service->name, 'root' => $service->root, 'limit' => $limit->toArray(), 'endpoints' => $eps);
}
return Response::json($response);
}
示例12: update
public function update($id)
{
$params = $_POST;
$services = Service::all();
$attributes = array('id' => $id, 'name' => $params['name'], 'special' => $params['special'], 'introduction' => $params['introduction']);
$employee = new Employee($attributes);
$errors = $employee->errors();
foreach ($services as $serv) {
if (isset($_POST[$serv->id])) {
OfferedServicesController::create($id, $serv->id);
} else {
OfferedServicesController::destroy($id, $serv->id);
}
}
$serviceList = OfferedServicesController::getServices($id, $services);
if (count($errors) > 0) {
View::make('employee/edit.html', array('errors' => $errors, 'attributes' => $attributes, 'services' => $services, 'serviceList' => $serviceList));
} else {
$employee->update();
Redirect::to('/tyontekijat/' . $employee->id, array('message' => "Työntekijään tehdyt muutokset tallennettu!"));
}
}
示例13: listServices
public function listServices()
{
$services = Service::all();
return View::make('services', compact('services'));
}
示例14: e
<input type="text" name="vendor[contact_name]" value="<?php
echo e($vendor['contact_name']);
?>
" />
</div>
<div class="control-group">
<label class="required">Your company in 50 words or less</label>
<textarea class="input-xlarge" name="vendor[more_info]" rows="7"><?php
echo e($vendor['more_info']);
?>
</textarea>
</div>
<div class="control-group">
<label class="required">What kind of work does your company do?</label>
<?php
foreach (Service::all() as $service) {
?>
<label class="checkbox">
<input type="checkbox" name="services[<?php
echo e($service->id);
?>
]" <?php
echo e(isset($services[$service->id]) ? "checked" : "");
?>
/>
<?php
echo e($service->name);
?>
</label>
<?php
}
示例15: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return View::make('services.index')->with('services', Service::all())->with('title', 'Services');
}