本文整理匯總了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();
}