处理在线资源的名称为空的错误

This commit is contained in:
wlx 2014-03-21 01:43:25 +00:00
parent 2225a3e7f6
commit 4a0307c1dd
1 changed files with 8 additions and 2 deletions

View File

@ -208,9 +208,15 @@ class ISO19115
$id=$db->lastInsertId('metadata','id'); $id=$db->lastInsertId('metadata','id');
//处理在线资源 //处理在线资源
if ($this->onlineresource) foreach($this->onlineresource as $resource) if ($this->onlineresource) foreach($this->onlineresource as $resource)
{
if ($resource['name'])
{ {
$sql="insert into onlineresource (uuid,linkage,protocol,name,description) values(?,?,?,?,?)"; $sql="insert into onlineresource (uuid,linkage,protocol,name,description) values(?,?,?,?,?)";
$db->query($sql,array($this->uuid,$resource['linkage'],$resource['protocol'],$resource['name'],$resource['description'])); $db->query($sql,array($this->uuid,$resource['linkage'],$resource['protocol'],$resource['name'],$resource['description']));
} else {
$sql="insert into onlineresource (uuid,linkage,protocol,description) values(?,?,?,?)";
$db->query($sql,array($this->uuid,$resource['linkage'],$resource['protocol'],$resource['description']));
}
} }
//处理缩略图 //处理缩略图
if (!empty($this->thumbnail)) { if (!empty($this->thumbnail)) {