本文整理汇总了PHP中Provider::getLocation方法的典型用法代码示例。如果您正苦于以下问题:PHP Provider::getLocation方法的具体用法?PHP Provider::getLocation怎么用?PHP Provider::getLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Provider
的用法示例。
在下文中一共展示了Provider::getLocation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Renderize the view.
*
* @return null
*/
public function render(array $providerCategories, Provider $provider)
{
?>
<p>
<?php
echo REQUIRED_FIELDS_TEXT;
?>
</p>
<form action="<?php
echo $this->generateURL('provider', 'edit', $provider->getIdProvider());
?>
" method="post">
<fieldset>
<div class="row">
<div class="col-md-6">
<div>
<label for="id_provider_category">
Categoría <small>(*)</small>
</label>
<select name="id_provider_category" required>
<option value="">
Seleccionar
</option>
<?php
foreach ($providerCategories as $providerCategory) {
if ($provider->getIdProviderCategory() === $providerCategory->getIdProviderCategory()) {
?>
<option value="<?php
echo $providerCategory->getIdProviderCategory();
?>
" selected>
<?php
echo $providerCategory->getCategoryName();
?>
</option>
<?php
} else {
?>
<option value="<?php
echo $providerCategory->getIdProviderCategory();
?>
">
<?php
echo $providerCategory->getCategoryName();
?>
</option>
<?php
}
}
?>
</select>
</div>
<div>
<label for="provider_name">
Nombre <small>(*)</small>
</label>
<input name="provider_name" type="text" required value="<?php
echo $provider->getProviderName();
?>
" />
</div>
<div>
<label for="location">
Ubicación <small>(*)</small>
</label>
<input name="location" type="text" required value="<?php
echo $provider->getLocation();
?>
" />
</div>
</div>
<div class="col-md-6">
<div>
<label for="phone">
Teléfono <small>(*)</small>
</label>
<input name="phone" type="tel" required value="<?php
echo $provider->getPhone();
?>
" />
</div>
<div>
//.........这里部分代码省略.........
示例2: editProvider
/**
* Modify a provider saved in the database.
*
* @param Provider $provider
* @return integer
*/
public function editProvider(Provider $provider)
{
$sql = "UPDATE provider \n\t\t\tSET id_provider_category = '" . $provider->getIdProviderCategory() . "', provider_name = '" . replaceCharacters($provider->getProviderName()) . "', location = '" . replaceCharacters($provider->getLocation()) . "', phone = '" . $provider->getPhone() . "', website = '" . $provider->getWebsite() . "' WHERE id_provider = '" . $provider->getIdProvider() . "'";
return DB::query($sql);
}