本文整理汇总了PHP中ElementHelper::build_element_file_path方法的典型用法代码示例。如果您正苦于以下问题:PHP ElementHelper::build_element_file_path方法的具体用法?PHP ElementHelper::build_element_file_path怎么用?PHP ElementHelper::build_element_file_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ElementHelper
的用法示例。
在下文中一共展示了ElementHelper::build_element_file_path方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
// If file has been updated, update the element and sync
if ($file['mod_time'] > $element_sync->get_element_mod_time($type, $file['name'])) {
$properties = $element_helper->get_file_element_properties($type_path, $file_path);
if ($element->set_properties($properties)) {
$element_sync->add_element($type, $file['name'], $file['mod_time']);
}
}
}
}
}
// Process the elements for this element type
foreach ($modx->getCollection($type) as $element_object) {
$element = Element::insert($element_object);
$name = $element->get_property('name');
$category_id = $element->get_property('category');
$file_path = $element_helper->build_element_file_path($type, $type_path, $name, $category_id);
// Check if the element is blacklisted
if (in_array($name, $element_blacklist)) {
continue;
}
// Check if the element has a category and is whitelisted
if ($category_id !== 0) {
$category = Element::get($modx, 'modCategory', $category_id);
if (!in_array($category->get_property('name'), $category_whitelist)) {
continue;
}
}
// If a file with this element name doesn't exist
if (!file_exists($file_path)) {
// If the element is not in the sync
if (!$element_sync->has_element($type, $name)) {