コード例 #1
0
 public function delFile($params)
 {
     return churchcore_delFile($params["id"]);
 }
コード例 #2
0
/**
 * 
 * @param a $params
 */
function churchservice_deleteSong($params)
{
    $arrs = churchcore_getTableData('cs_song_arrangement', null, 'song_id=' . $params["id"]);
    $files = churchcore_getFiles("song_arrangement");
    if ($arrs) {
        foreach ($arrs as $arr) {
            //TODO: without if there was an error on deleting a song - return always an array in function
            if ($files) {
                foreach ($files as $file) {
                    if ($file->domain_id == $arr->id) {
                        churchcore_delFile($file->id);
                    }
                }
            }
        }
    }
    $i = new CTInterface();
    $i->setParam("id");
    db_delete("cs_song_arrangement")->fields($i->getDBInsertArrayFromParams($params))->condition("song_id", $params["id"], "=")->execute(false);
    db_delete("cs_song")->fields($i->getDBInsertArrayFromParams($params))->condition("id", $params["id"], "=")->execute(false);
}