当前位置: 首页>>代码示例>>PHP>>正文


PHP BlockInstance::bulk_delete_artefacts方法代码示例

本文整理汇总了PHP中BlockInstance::bulk_delete_artefacts方法的典型用法代码示例。如果您正苦于以下问题:PHP BlockInstance::bulk_delete_artefacts方法的具体用法?PHP BlockInstance::bulk_delete_artefacts怎么用?PHP BlockInstance::bulk_delete_artefacts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BlockInstance的用法示例。


在下文中一共展示了BlockInstance::bulk_delete_artefacts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _delete_dbrecords

 private static function _delete_dbrecords($artefactids)
 {
     if (empty($artefactids)) {
         return;
     }
     $idstr = '(' . join(',', array_map('intval', $artefactids)) . ')';
     db_begin();
     // Detach any files from this artefact
     delete_records_select('artefact_attachment', "artefact IN {$idstr}");
     // Make sure that the artefacts are removed from any view blockinstances
     if ($records = get_records_sql_array("\n            SELECT va.block, va.artefact, bi.configdata\n            FROM {view_artefact} va JOIN {block_instance} bi ON va.block = bi.id\n            WHERE va.artefact IN {$idstr}", array())) {
         require_once get_config('docroot') . 'blocktype/lib.php';
         BlockInstance::bulk_delete_artefacts($records);
     }
     delete_records_select('view_artefact', "artefact IN {$idstr}");
     delete_records_select('artefact_tag', "artefact IN {$idstr}");
     delete_records_select('artefact_access_role', "artefact IN {$idstr}");
     delete_records_select('artefact_access_usr', "artefact IN {$idstr}");
     execute_sql("UPDATE {usr} SET profileicon = NULL WHERE profileicon IN {$idstr}");
     execute_sql("UPDATE {institution} SET logo = NULL WHERE logo IN {$idstr}");
     // Delete any references to files embedded in textboxes
     delete_records_select('artefact_file_embedded', "fileid IN {$idstr}");
     delete_records_select('artefact', "id IN {$idstr}");
     db_commit();
 }
开发者ID:kienv,项目名称:mahara,代码行数:25,代码来源:lib.php

示例2: _delete_dbrecords

 private static function _delete_dbrecords($artefactids)
 {
     if (empty($artefactids)) {
         return;
     }
     $idstr = '(' . join(',', array_map('intval', $artefactids)) . ')';
     db_begin();
     // Detach any files from this artefact
     delete_records_select('artefact_attachment', "artefact IN {$idstr}");
     // Delete any references to these artefacts from non-artefact places.
     delete_records_select('artefact_parent_cache', "artefact IN {$idstr}");
     // The artefacts should have no 'real' children at this point, but they
     // could still be in the artefact_parent_cache as parents if they had
     // attachments, or if any of their children had attachments.
     delete_records_select('artefact_parent_cache', "parent IN {$idstr}");
     // Make sure that the artefacts are removed from any view blockinstances
     if ($records = get_records_sql_array("\n            SELECT va.block, va.artefact, bi.configdata\n            FROM {view_artefact} va JOIN {block_instance} bi ON va.block = bi.id\n            WHERE va.artefact IN {$idstr}", array())) {
         require_once get_config('docroot') . 'blocktype/lib.php';
         BlockInstance::bulk_delete_artefacts($records);
     }
     delete_records_select('view_artefact', "artefact IN {$idstr}");
     delete_records_select('artefact_tag', "artefact IN {$idstr}");
     delete_records_select('artefact_access_role', "artefact IN {$idstr}");
     delete_records_select('artefact_access_usr', "artefact IN {$idstr}");
     delete_records_select('artefact', "id IN {$idstr}");
     db_commit();
 }
开发者ID:richardmansfield,项目名称:richardms-mahara,代码行数:27,代码来源:lib.php


注:本文中的BlockInstance::bulk_delete_artefacts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。