本文整理汇总了PHP中Includes\Utils\ArrayManager::getArraysArrayFieldValues方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayManager::getArraysArrayFieldValues方法的具体用法?PHP ArrayManager::getArraysArrayFieldValues怎么用?PHP ArrayManager::getArraysArrayFieldValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Includes\Utils\ArrayManager
的用法示例。
在下文中一共展示了ArrayManager::getArraysArrayFieldValues方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareListChildTemplates
/**
* Prepare list childs templates-based
*
* @param array $list List
*
* @return array
*/
protected function prepareListChildTemplates(array $list)
{
\XLite::getInstance()->initModules();
$skins = array();
$hasSubstSkins = false;
foreach (\XLite\Core\Layout::getInstance()->getSkinsAll() as $interface => $path) {
$skins[$interface] = \XLite\Core\Layout::getInstance()->getSkins($interface);
if (!$hasSubstSkins) {
$hasSubstSkins = 1 < count($skins[$interface]);
}
}
if ($hasSubstSkins) {
$patterns = $hash = array();
foreach ($skins as $interface => $data) {
$patterns[$interface] = array();
foreach ($data as $skin) {
$patterns[$interface][] = preg_quote($skin, '/');
}
$patterns[$interface] = '/^(' . implode('|', $patterns[$interface]) . ')' . preg_quote(LC_DS, '/') . '/US';
}
foreach ($list as $index => $item) {
$path = \Includes\Utils\FileManager::getRelativePath($item['path'], LC_DIR_SKINS);
if (preg_match($patterns[$item['zone']], $path, $matches)) {
$hash[$item['zone']][$matches[1]][$item['tpl']][] = $index;
}
}
foreach ($hash as $interface => &$data) {
$data[static::PREPARED_SKIN_NAME] = array();
foreach (array_reverse($skins[$interface]) as $skin) {
if (!empty($data[$skin])) {
foreach ($data[$skin] as $tpl => $indexes) {
$data[static::PREPARED_SKIN_NAME][$tpl] = $indexes;
}
}
}
}
$index = \Includes\Utils\ArrayManager::getArraysArrayFieldValues($hash, static::PREPARED_SKIN_NAME);
unset($hash);
$ids = array();
foreach ($index as $interface => $tpls) {
foreach ($tpls as $tpl => $indexes) {
$ids = array_merge($ids, $indexes);
}
}
unset($index);
$list = \Includes\Utils\ArrayManager::filterByKeys($list, $ids);
}
return $list;
}