本文整理汇总了PHP中RevSlide::setArrChildren方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSlide::setArrChildren方法的具体用法?PHP RevSlide::setArrChildren怎么用?PHP RevSlide::setArrChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSlide
的用法示例。
在下文中一共展示了RevSlide::setArrChildren方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSlidesFromGallery
/**
*
* get slides of the current slider
*/
public function getSlidesFromGallery($publishedOnly = false)
{
$this->validateInited();
$arrSlides = array();
$arrSlideRecords = $this->db->fetch(GlobalsRevSlider::$table_slides, "slider_id=" . $this->id, "slide_order");
$arrChildren = array();
foreach ($arrSlideRecords as $record) {
$slide = new RevSlide();
$slide->initByData($record);
$slideID = $slide->getID();
$arrIdsAssoc[$slideID] = true;
if ($publishedOnly == true) {
$state = $slide->getParam("state", "published");
if ($state == "unpublished") {
continue;
}
}
$parentID = $slide->getParam("parentid", "");
if (!empty($parentID)) {
$lang = $slide->getParam("lang", "");
if (!isset($arrChildren[$parentID])) {
$arrChildren[$parentID] = array();
}
$arrChildren[$parentID][] = $slide;
continue;
//skip adding to main list
}
//init the children array
$slide->setArrChildren(array());
$arrSlides[$slideID] = $slide;
}
//add children array to the parent slides
foreach ($arrChildren as $parentID => $arr) {
if (!isset($arrSlides[$parentID])) {
continue;
}
$arrSlides[$parentID]->setArrChildren($arr);
}
$this->arrSlides = $arrSlides;
return $arrSlides;
}