Ejemplo n.º 1
0
 /**
  *  Unbinds the file with given ID
  *
  * @param $fileId - identifier of file in b_file table
  * @param $appCode - application code
  */
 public static function unregisterFileInApp($fileId, $appCode)
 {
     $result = AppTable::getById($appCode);
     $appData = $result->fetchAll();
     if (count($appData) > 0) {
         $index = array_search($fileId, $appData[0]["FILES"]);
         if ($index !== false) {
             unset($appData[0]["FILES"][$index]);
             AppTable::update($appCode, array("FILES" => $appData[0]["FILES"]));
         }
         die;
     }
 }