本文整理汇总了PHP中Service::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Service::where方法的具体用法?PHP Service::where怎么用?PHP Service::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Service
的用法示例。
在下文中一共展示了Service::where方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exists
public static function exists($service_id)
{
$service = Service::where('id', '=', $service_id)->count();
if ($service > 0) {
return true;
} else {
return false;
}
}
示例2: getUpdate
public function getUpdate($business_id, $field, $value)
{
$first_branch = Branch::where('business_id', '=', $business_id)->first();
$first_service = Service::where('branch_id', '=', $first_branch->branch_id)->first();
if (QueueSettings::serviceExists($first_service->service_id)) {
QueueSettings::updateQueueSetting($first_service->service_id, $field, $value);
} else {
QueueSettings::createQueueSetting(['service_id' => $first_service->service_id, 'date' => mktime(0, 0, 0, date('m'), date('d'), date('Y')), $field => $value]);
}
return json_encode(['success' => 1]);
}
示例3: 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());
}
示例4: getServiceNames
public function getServiceNames($outlet_id)
{
Activity::log(['contentId' => $outlet_id, 'contentType' => 'OutletService', 'action' => 'GetServiceNames', 'description' => 'Get List Service for an Outlet', 'details' => 'Outlet Id: ' . $outlet_id, 'updated' => false]);
return Service::where('outlet_id', '=', $outlet_id)->get();
}
示例5: User
ActiveMongo::connect("test");
User::drop();
Service::drop();
/* Create an user for our 'aggregator' */
$user = new User();
$user->username = "crodas";
$user->password = "crodas";
$user->save();
/* Now we are going to query for the services for
* the new user, it will return an empty
* dataset, but we're going to create a 'dynamic' reference
* to the 'query'. When this reference is deference
* then same 'query' is going to be asked to the database.
*/
$service = new Service();
$service->where('user', $user->getID())->doQuery();
/* save reference */
$user->services = $service->getReference(TRUE);
$user->save();
/* Create one service, note that Service::user is $user->getID() */
$twt = new Twitter();
$twt->user = $user->getID();
$twt->rss = "http://twitter.com/statuses/user_timeline/crodas.rss";
$twt->save();
/* Create another service */
$blg = new Blog();
$blg->user = $user->getID();
$blg->rss = "http://crodas.org/feed/rss";
$blg->save();
/* Create another service */
$blg1 = new Blog();