Example #1
0
 public function _getPlaylist($hash = NULL, $lookThroughAll = false, $excludeVideo_id = NULL, $exclude_id = NULL, $limitFrom = NULL, $limitTo = NULL, $getTotal = false, $returnQuery = false)
 {
     Trace::output($this->traceID, "getPlaylist: " . print_r(func_get_args(), true));
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $excludeVideo_id = GenFun::varChk($excludeVideo_id);
     //----------------------------------------------------------
     $whereArr = array();
     //----------------------------------------------------------
     if (!$lookThroughAll) {
         $whereArr["title"] = "{ignore} IS NOT NULL";
         $whereArr["disabled"] = "{ignore} IS NULL";
     }
     //----------------------------------------------------------
     if (!is_null($hash)) {
         $whereArr["hash"] = $hash;
     }
     //----------------------------------------------------------
     if (!is_null($exclude_id)) {
         $whereArr["id"] = "{isnot}{$exclude_id}";
     }
     //----------------------------------------------------------
     if (!is_null($excludeVideo_id)) {
         $whereArr['id'] = "{notin}" . $this->getPlaylistWithVideo($excludeVideo_id, false, true);
     }
     //----------------------------------------------------------
     $chk = GetTable::go("playlist", $whereArr, array('getTotalRows' => $getTotal, "chkForQuery" => true, "returnQuery" => $returnQuery ? true : false));
     //----------------------------------------------------------
     if (!is_null($hash)) {
         $chk['result'] = $chk['result'][0];
     }
     //----------------------------------------------------------
     return $chk;
 }