示例#1
0
    /**
     * Update package size and hash.
     */
    protected function update_package_stats()
    {
        $sql_ary = array('filesize' => $this->package->get_size(), 'hash' => $this->package->get_md5_hash());
        // Update the attachment MD5 and filesize, it may have changed
        $sql = 'UPDATE ' . TITANIA_ATTACHMENTS_TABLE . '
			SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
			WHERE attachment_id = ' . (int) $this->attachment->get_id();
        $this->db->sql_query($sql);
    }
示例#2
0
 /**
  * Append attachment object to set.
  *
  * @param attachment $attachment
  * @return $this
  */
 public function set(attachment $attachment)
 {
     $this->attachments[$attachment->get_id()] = $attachment;
     return $this;
 }