Author: david
Date: Tue Jul 19 16:41:15 2011
New Revision: 9337

Log:
Set checksum_type to a string

Modified:
   trunk/lib/model/QubitDigitalObject.php

Modified: trunk/lib/model/QubitDigitalObject.php
==============================================================================
--- trunk/lib/model/QubitDigitalObject.php      Tue Jul 19 16:32:23 2011        
(r9336)
+++ trunk/lib/model/QubitDigitalObject.php      Tue Jul 19 16:41:15 2011        
(r9337)
@@ -518,6 +518,7 @@
     $this->name = $filename;
     $this->path = $uri;
     $this->checksum = $asset->getChecksum();
+    $this->checksumType = $asset->getChecksumAlgorithm();
     $this->byteSize = strlen($browser->getResponseText());
     $this->setMimeAndMediaType();
   }
@@ -1774,9 +1775,9 @@
    */
   public function setChecksum($value, $options)
   {
-    if (isset($options['checksumTypeId']))
+    if (isset($options['checksumType']))
     {
-      $this->setChecksumTypeId($options['checksumTypeId']);
+      $this->setChecksumType($options['checksumType']);
     }
 
     $this->checksum = $value;
@@ -1792,16 +1793,14 @@
    */
   public function generateChecksumFromFile($filename)
   {
-    switch($this->checksumTypeId)
+    switch($this->checksumType)
     {
       case 'sha1':
         $this->checksum = sha1_file($filename);
-        //$this->checksumTypeId = QubitTerm::CHECKSUM_SHA1_ID;
         break;
-      case 'md5':
       default:
         $this->checksum = md5_file($filename);
-        //$this->checksumTypeId = QubitTerm::CHECKSUM_MD5_ID;
+        $this->checksumType = 'md5';
     }
 
     return $this;

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to