本文整理汇总了PHP中UniteFunctionsRev::trimArrayItems方法的典型用法代码示例。如果您正苦于以下问题:PHP UniteFunctionsRev::trimArrayItems方法的具体用法?PHP UniteFunctionsRev::trimArrayItems怎么用?PHP UniteFunctionsRev::trimArrayItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniteFunctionsRev
的用法示例。
在下文中一共展示了UniteFunctionsRev::trimArrayItems方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createUpdateSliderFromOptions
/**
*
* create / update slider from options
*/
private function createUpdateSliderFromOptions($options, $sliderID = null, $settingsMain, $settingsParams)
{
$arrMain = UniteFunctionsRev::getVal($options, "main");
$params = UniteFunctionsRev::getVal($options, "params");
$isTemplate = UniteFunctionsRev::getVal($options, "template");
if ($isTemplate == "true") {
$params['template'] = "true";
} else {
$params['template'] = "false";
}
//trim all input data
$arrMain = UniteFunctionsRev::trimArrayItems($arrMain);
//modify the data
$arrMain = $settingsMain->setStoredValues($arrMain);
$params = UniteFunctionsRev::trimArrayItems($params);
$params = $settingsParams->setStoredValues($params);
$params = array_merge($arrMain, $params);
$title = UniteFunctionsRev::getVal($arrMain, "title");
$alias = UniteFunctionsRev::getVal($arrMain, "alias");
if (!empty($sliderID)) {
$this->initByID($sliderID);
}
$this->validateInputSettings($title, $alias, $params);
$jsonParams = json_encode($params);
//insert slider to database
$arrData = array();
$arrData["title"] = $title;
$arrData["alias"] = $alias;
$arrData["params"] = $jsonParams;
if (empty($sliderID)) {
//create slider
$sliderID = $this->db->insert(GlobalsRevSlider::$table_sliders, $arrData);
return $sliderID;
} else {
//update slider
$this->initByID($sliderID);
$sliderID = $this->db->update(GlobalsRevSlider::$table_sliders, $arrData, array("id" => $sliderID));
}
}