Example #1
0
 public function __construct($vals = null)
 {
     if (!isset(self::$_TSPEC)) {
         self::$_TSPEC = array(1 => array('var' => 'pid', 'type' => TType::I32), 2 => array('var' => 'name', 'type' => TType::STRING), 3 => array('var' => 'folder', 'type' => TType::STRING), 4 => array('var' => 'site', 'type' => TType::STRING), 5 => array('var' => 'password', 'type' => TType::STRING), 6 => array('var' => 'dest', 'type' => TType::I32), 7 => array('var' => 'order', 'type' => TType::I16), 8 => array('var' => 'priority', 'type' => TType::BYTE), 9 => array('var' => 'links', 'type' => TType::LST, 'etype' => TType::I32, 'elem' => array('type' => TType::I32)));
     }
     if (is_array($vals)) {
         if (isset($vals['pid'])) {
             $this->pid = $vals['pid'];
         }
         if (isset($vals['name'])) {
             $this->name = $vals['name'];
         }
         if (isset($vals['folder'])) {
             $this->folder = $vals['folder'];
         }
         if (isset($vals['site'])) {
             $this->site = $vals['site'];
         }
         if (isset($vals['password'])) {
             $this->password = $vals['password'];
         }
         if (isset($vals['dest'])) {
             $this->dest = $vals['dest'];
         }
         if (isset($vals['order'])) {
             $this->order = $vals['order'];
         }
         if (isset($vals['priority'])) {
             $this->priority = $vals['priority'];
         }
         if (isset($vals['links'])) {
             $this->links = $vals['links'];
         }
     }
 }
Example #2
0
 public function read($input)
 {
     $xfer = 0;
     $fname = null;
     $ftype = 0;
     $fid = 0;
     $xfer += $input->readStructBegin($fname);
     while (true) {
         $xfer += $input->readFieldBegin($fname, $ftype, $fid);
         if ($ftype == TType::STOP) {
             break;
         }
         switch ($fid) {
             case 0:
                 if ($ftype == TType::LST) {
                     $this->success = array();
                     $_size111 = 0;
                     $_etype114 = 0;
                     $xfer += $input->readListBegin($_etype114, $_size111);
                     for ($_i115 = 0; $_i115 < $_size111; ++$_i115) {
                         $elem116 = null;
                         $elem116 = new PackageInfo();
                         $xfer += $elem116->read($input);
                         $this->success[] = $elem116;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }