Torrent::is_private PHP Method

is_private() public method

Getter and setter of private flag
public is_private ( $private = null ) : boolean
return boolean private flag
    public function is_private($private = null)
    {
        return is_null($private) ? !empty($this->info['private']) : $this->touch($this->info['private'] = $private ? 1 : 0);
    }

Usage Example

 if (count($announce_list) > 0) {
     $torrent = new Torrent($path_edit, $announce_list[0][0], $piece_size, $callback_log, $callback_err);
     if ($trackersCount > 1) {
         $torrent->announce_list($announce_list);
     }
 } else {
     $torrent = new Torrent($path_edit, array(), $piece_size, $callback_log, $callback_err);
 }
 if (isset($request['comment'])) {
     $comment = trim($request['comment']);
     if (strlen($comment)) {
         $torrent->comment($comment);
     }
 }
 if ($request['private']) {
     $torrent->is_private(true);
 }
 $fname = rTask::formatPath($taskNo) . '/result.torrent';
 $torrent->save($fname);
 if ($request['start_seeding']) {
     $fname = getUniqueUploadedFilename($torrent->info['name'] . '.torrent');
     $path_edit = trim($request['path_edit']);
     if (is_dir($path_edit)) {
         $path_edit = addslash($path_edit);
     }
     if (rTorrentSettings::get()->correctDirectory($path_edit)) {
         $path_edit = dirname($path_edit);
         if ($resumed = rTorrent::fastResume($torrent, $path_edit)) {
             $torrent = $resumed;
         }
         $torrent->save($fname);
All Usage Examples Of Torrent::is_private