本文整理匯總了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;
}