本文整理汇总了PHP中Place::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Place::find方法的具体用法?PHP Place::find怎么用?PHP Place::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Place
的用法示例。
在下文中一共展示了Place::find方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uploadImage
public function uploadImage($placeId)
{
$place = Place::find($placeId);
if (!$place) {
return $this->errorNotFound('Place not found');
}
exit('This would normally upload an image somewhere but that is hard.');
}
示例2: show
public function show($id)
{
$place = Place::find($id);
if (!$place) {
return $this->errorNotFound('Did you just invent an ID and try loading a place? Muppet.');
}
return $this->respondWithItem($place, new PlaceTransformer());
}
示例3: getSelectPlaces
public function getSelectPlaces()
{
$placeModels = Place::find();
$places = [0 => 'Немає'];
foreach ($placeModels as $place) {
$places[$place->id] = $place->name;
}
return $places;
}
示例4: show
public function show($id)
{
$place = Place::find($id);
return $this->respondWithItem($place, new PlaceTransformer());
}
示例5: edit
/**
* Show the form for editing the specified place.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$place = Place::find($id);
return View::make('places.edit', compact('place'));
}
示例6: handleRequest
public function handleRequest()
{
// Fetch all the places:
$places = Place::find();
render('place', array('title' => 'Browsing places', 'places' => $places));
}
示例7: borrar_lugar
public function borrar_lugar()
{
$id = Input::get('idedit');
$lugar = Place::find($id);
if ($lugar->delete()) {
Session::flash('message', 'Eliminado correctamente');
Session::flash('class', 'success');
} else {
Session::flash('message', 'Ha ocurrido un error, intentelo nuevamente');
Session::flash('class', 'danger');
}
return Redirect::to('lugar');
}
示例8: getMeetUpLocation
static function getMeetUpLocation($user1_id, $user2_id)
{
$query = $GLOBALS['DB']->query("SELECT location_id FROM meetups WHERE user1_id = {$user1_id} AND user2_id = {$user2_id} AND confirm_meet_usr1 IS NULL;");
$result = $query->fetchAll(PDO::FETCH_ASSOC);
$location_id = $result[0]['location_id'];
$meetup_spot = Place::find($location_id);
return $meetup_spot;
}