本文整理汇总了PHP中Fields::removeFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Fields::removeFile方法的具体用法?PHP Fields::removeFile怎么用?PHP Fields::removeFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fields
的用法示例。
在下文中一共展示了Fields::removeFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: del
function del()
{
$ids = Tree::getChilds($_GET['id']);
$ids[] = $_GET['id'];
foreach ($ids as $id) {
Tree::saveSearch($id);
$sql = '
SELECT * FROM {{data}}
WHERE type=\'gallery\' AND tree=\'' . $id . '\'
';
$gals = DB::getAll($sql);
foreach ($gals as $item) {
if ($item['id']) {
$sql = '
SELECT * FROM {{relations}}
WHERE modul1=\'data\' AND modul2=\'files\' AND id1=\'' . $item['id'] . '\'
';
$files = DB::getAll($sql);
foreach ($files as $file) {
$sql = '
SELECT id1 FROM {{relations}}
WHERE modul1=\'data\' AND modul2=\'files\' AND id1<>\'' . $item['id'] . '\' AND id2=' . $file['id2'] . '
';
$id1 = DB::getOne($sql);
if (!$id1) {
Fields::removeFile($item['id'], $file['id2']);
}
}
}
}
$sql = '
DELETE FROM {{relations}}
WHERE modul1=\'tree\' AND id1=\'' . $id . '\'
';
DB::exec($sql);
$sql = '
DELETE FROM {{data}}
WHERE tree=\'' . $id . '\'
';
DB::exec($sql);
$sql = '
DELETE FROM {{tree}}
WHERE id=\'' . $id . '\'
';
DB::exec($sql);
$sql = '
DELETE FROM {{catalog}}
WHERE tree=\'' . $id . '\'
';
DB::exec($sql);
}
}
示例2: removeGallery
public function removeGallery($id)
{
$sql = '
SELECT id2 FROM {{relations}}
WHERE modul1=\'data\' AND modul2=\'files\' AND id1=' . $id . '
';
$files = DB::getAll($sql, 'id2');
foreach ($files as $item) {
Fields::removeFile($id, $item);
}
$sql = '
DELETE FROM {{data}}
WHERE id=' . $id . '
';
DB::exec($sql);
}
示例3: removefile
function removefile()
{
Fields::removeFile();
}