| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347 |
- <?php
- namespace Transmission\Model;
- /**
- * @author Ramon Kleiss <ramon@cubilon.nl>
- */
- class Peer extends AbstractModel
- {
- /**
- * @var string
- */
- protected $address;
- /**
- * @var integer
- */
- protected $port;
- /**
- * @var string
- */
- protected $clientName;
- /**
- * @var boolean
- */
- protected $clientChoked;
- /**
- * @var boolean
- */
- protected $clientInterested;
- /**
- * @var boolean
- */
- protected $downloading;
- /**
- * @var boolean
- */
- protected $encrypted;
- /**
- * @var boolean
- */
- protected $incoming;
- /**
- * @var boolean
- */
- protected $uploading;
- /**
- * @var boolean
- */
- protected $utp;
- /**
- * @var boolean
- */
- protected $peerChoked;
- /**
- * @var boolean
- */
- protected $peerInterested;
- /**
- * @var double
- */
- protected $progress;
- /**
- * @var integer
- */
- protected $uploadRate;
- /**
- * @var integer
- */
- protected $downloadRate;
- /**
- * @param string $address
- */
- public function setAddress($address)
- {
- $this->address = (string) $address;
- }
- /**
- * @return string
- */
- public function getAddress()
- {
- return $this->address;
- }
- /**
- * @param integer $port
- */
- public function setPort($port)
- {
- $this->port = (integer) $port;
- }
- /**
- * @return integer
- */
- public function getPort()
- {
- return $this->port;
- }
- /**
- * @param string $clientName
- */
- public function setClientName($clientName)
- {
- $this->clientName = (string) $clientName;
- }
- /**
- * @return string
- */
- public function getClientName()
- {
- return $this->clientName;
- }
- /**
- * @param boolean $choked
- */
- public function setClientChoked($choked)
- {
- $this->clientChoked = (boolean) $choked;
- }
- /**
- * @return boolean
- */
- public function isClientChoked()
- {
- return $this->clientChoked;
- }
- /**
- * @param boolean $interested
- */
- public function setClientInterested($interested)
- {
- $this->clientInterested = (boolean) $interested;
- }
- /**
- * @return boolean
- */
- public function isClientInterested()
- {
- return $this->clientInterested;
- }
- /**
- * @param boolean $downloading
- */
- public function setDownloading($downloading)
- {
- $this->downloading = (boolean) $downloading;
- }
- /**
- * @return boolean
- */
- public function isDownloading()
- {
- return $this->downloading;
- }
- /**
- * @param boolean $encrypted
- */
- public function setEncrypted($encrypted)
- {
- $this->encrypted = (boolean) $encrypted;
- }
- /**
- * @return boolean
- */
- public function isEncrypted()
- {
- return $this->encrypted;
- }
- /**
- * @param boolean $incoming
- */
- public function setIncoming($incoming)
- {
- $this->incoming = (boolean) $incoming;
- }
- /**
- * @return boolean
- */
- public function isIncoming()
- {
- return $this->incoming;
- }
- /**
- * @param boolean $uploading
- */
- public function setUploading($uploading)
- {
- $this->uploading = (boolean) $uploading;
- }
- /**
- * @return boolean
- */
- public function isUploading()
- {
- return $this->uploading;
- }
- /**
- * @param boolean $utp
- */
- public function setUtp($utp)
- {
- $this->utp = (boolean) $utp;
- }
- /**
- * @return boolean
- */
- public function isUtp()
- {
- return $this->utp;
- }
- /**
- * @param boolean $choked
- */
- public function setPeerChoked($choked)
- {
- $this->peerChoked = (boolean) $choked;
- }
- /**
- * @return boolean
- */
- public function isPeerChoked()
- {
- return $this->peerChoked;
- }
- /**
- * @param boolean $interested
- */
- public function setPeerInterested($interested)
- {
- $this->peerInterested = (boolean) $interested;
- }
- /**
- * @return boolean
- */
- public function isPeerInterested()
- {
- return $this->peerInterested;
- }
- /**
- * @param double $progress
- */
- public function setProgress($progress)
- {
- $this->progress = (double) $progress;
- }
- /**
- * @return double
- */
- public function getProgress()
- {
- return $this->progress;
- }
- /**
- * @param integer $rate
- */
- public function setUploadRate($rate)
- {
- $this->uploadRate = (integer) $rate;
- }
- /**
- * @return integer
- */
- public function getUploadRate()
- {
- return $this->uploadRate;
- }
- /**
- * @param integer $rate
- */
- public function setDownloadRate($rate)
- {
- $this->downloadRate = (integer) $rate;
- }
- /**
- * @return integer
- */
- public function getDownloadRate()
- {
- return $this->downloadRate;
- }
- /**
- * {@inheritDoc}
- */
- public static function getMapping()
- {
- return array(
- 'address' => 'address',
- 'port' => 'port',
- 'clientName' => 'clientName',
- 'clientIsChoked' => 'clientChoked',
- 'clientIsInterested' => 'clientInterested',
- 'isDownloadingFrom' => 'downloading',
- 'isEncrypted' => 'encrypted',
- 'isIncoming' => 'incoming',
- 'isUploadingTo' => 'uploading',
- 'isUTP' => 'utp',
- 'peerIsChoked' => 'peerChoked',
- 'peerIsInterested' => 'peerInterested',
- 'progress' => 'progress',
- 'rateToClient' => 'uploadRate',
- 'rateFromClient' => 'downloadRate'
- );
- }
- }
|