Ejemplo n.º 1
0
 /**
  * Stores a CMbObject from a hash
  *
  * @param array   $hash  The associative array
  * @param boolean $force Force the object re-importation
  *
  * @return string The store message
  */
 function storeMbObject($hash, $force = false)
 {
     $db_id = $this->getId($hash);
     $object = $this->getMbObject($db_id);
     // If object was already imported
     if (!$force && $object->_id) {
         return null;
     }
     $this->mapHashToMbObject($hash, $object);
     if (isset($this->_mb_object->_failed)) {
         return;
     }
     $this->_mb_object->repair();
     if ($msg = $this->_mb_object->store()) {
         CAppUI::setMsg($msg, UI_MSG_WARNING);
         return $msg;
     } else {
         CAppUI::setMsg("{$this->_mb_object->_class}-msg-create");
     }
     self::$_count_stored++;
     return self::storeIdExt($this->_mb_object, $this->getId($hash));
 }