本文整理匯總了PHP中Eloquent::fixBoardingType方法的典型用法代碼示例。如果您正苦於以下問題:PHP Eloquent::fixBoardingType方法的具體用法?PHP Eloquent::fixBoardingType怎麽用?PHP Eloquent::fixBoardingType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Eloquent
的用法示例。
在下文中一共展示了Eloquent::fixBoardingType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dataVoorbereiden
public static function dataVoorbereiden($data)
{
$data = parent::fixTransportationType($data);
$data = parent::fixBoardingType($data);
$data = parent::fixLandcodes($data);
$data = parent::fixAccommodationName($data);
$data = parent::fixStars($data);
$data = parent::fixDescription($data);
$data = parent::fixPositions($data);
$data = parent::fixDuration($data);
// Slug aan het einde laten staan
foreach (DaisyconHelper::getDatabaseFields() as $fieldname) {
if (str_contains($fieldname, 'slug_')) {
$originalFieldName = str_replace('slug_', '', $fieldname);
if (!empty($data->{$originalFieldName})) {
$data->{$fieldname} = Str::slug($data->{$originalFieldName});
}
}
// Encoding aanpassen
$data->{$fieldname} = html_entity_decode($data->{$fieldname}, ENT_QUOTES, "utf-8");
// nog testen
// Trim alle velden
$data->{$fieldname} = trim($data->{$fieldname});
// Specialchars aanpassen
$regex = '/http:\\/\\/.*/';
if (isset($data->{$fieldname}) && preg_match($regex, $data->{$fieldname})) {
$data->{$fieldname} = htmlspecialchars_decode(urldecode($data->{$fieldname}));
// sneller dan html_entity_decode @ http://stackoverflow.com/questions/11723641/how-to-decode-the-amp-from-a-url-so-that-header-works-urldecode-not-working
// Brakke utm_ arguments vervangen in url's
$regex = '/(&utm_\\w+=%\\w+%)&/';
if (preg_match_all($regex, $data->{$fieldname}, $matches)) {
$data->{$fieldname} = str_replace($matches[1], '', $data->{$fieldname});
}
}
}
return $data;
}