本文整理汇总了PHP中ca_objects::removeAllRepresentations方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_objects::removeAllRepresentations方法的具体用法?PHP ca_objects::removeAllRepresentations怎么用?PHP ca_objects::removeAllRepresentations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_objects
的用法示例。
在下文中一共展示了ca_objects::removeAllRepresentations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: commandImportSIPs
//.........这里部分代码省略.........
if ($o_log) {
$o_log->logError(_t("Could not add reel record %1: %2", $vs_idno, join("; ", $t_object->getErrors())));
}
}
$t_object->addLabel(array('name' => $vs_idno_padded), $pn_locale_id, null, true);
if ($t_object->numErrors()) {
if ($o_log) {
$o_log->logError(_t("Could not add label to reel record %1: %2", $vs_idno, join("; ", $t_object->getErrors())));
}
}
if ($t_object->numErrors()) {
if ($o_log) {
$o_log->logError(_t("Could not add artifct media %1 to reel %2: %3", pathinfo($vs_artifact, PATHINFO_BASENAME), $vs_idno, join("; ", $t_object->getErrors())));
}
}
} else {
if ($o_log) {
$o_log->logDebug(_t("Found existing reel record %1 for %2", $va_ids[0], $vs_idno));
}
$t_object = new ca_objects($vn_object_id = $va_ids[0]);
$t_object->setMode(ACCESS_WRITE);
$t_object->set('status', 5);
$t_object->update();
if (($vn_image_count = $t_object->numberOfRepresentationsOfClass("image")) > 0) {
// skip reels that have images already
//if ($o_log) { $o_log->logDebug(_t("Skipped existing reel record %1 because it already has %2 images", $vs_idno, $vn_image_count)); }
//if ($o_progress) { $o_progress->setError(_t("Skipped existing reel record %1 because it already has %2 images", $vs_idno, $vn_image_count)); }
//continue;
}
$t_object->setMode(ACCESS_WRITE);
}
//print "[7] ".$t->getTime(4)."\n";
if ($vn_image_count > 0) {
$t_object->removeAllRepresentations();
if ($t_object->numErrors()) {
if ($o_log) {
$o_log->logError(_t("Could not add remove existing media from reel %1: %2", $vs_idno, join("; ", $t_object->getErrors())));
}
}
}
$o_progress->setMessage(_t("Linking artifact images for %1", $vs_idno));
foreach ($va_artifacts as $vs_artifact) {
$o_progress->next(_t('Processing artifact image %1', $vs_artifact));
copy($vs_artifact, $vs_tmp_filepath = "/tmp/pbc" . md5(time()));
$t_object->addRepresentation($vs_tmp_filepath, 'front', $pn_locale_id, 0, 1, 1);
$o_progress->setMessage(_t("Added artifact image %1 for %2", $vs_artifact, $vs_idno));
if ($t_object->numErrors()) {
if ($o_log) {
$o_log->logError(_t("Could not add artifact media %1 to reel %2: %3", pathinfo($vs_artifact, PATHINFO_BASENAME), $vs_idno, join("; ", $t_object->getErrors())));
}
}
// remove tmp file
@unlink($vs_tmp_filepath);
}
//
// Add XML
//
$o_progress->setMessage(_t("Adding XML for %1", $vs_track_idno));
$t_object->removeAttributes('sip_metadata');
foreach ($va_side_xml as $vs_side => $vs_xml_path) {
copy($vs_xml_path, $vs_xml_tmppath = "/tmp/" . pathinfo($vs_xml_path, PATHINFO_BASENAME));
$o_progress->next(_t('Processing XML %1', $vs_xml_tmppath));
$t_object->addAttribute(array('sip_metadata' => $vs_xml_tmppath, 'locale_id' => $pn_locale_id), 'sip_metadata');
$t_object->update();
if ($t_object->numErrors()) {
if ($o_log) {