isConvertibleFrom() 공개 메소드

Returns true if the given type can be converted to the current field type.
public isConvertibleFrom ( $p_type ) : boolean
$p_type
리턴 boolean
예제 #1
0
	$f_src_c[$destColumn->getPrintName()] = $tmp;
}


// Verify the merge rules
$ok = true;
$errMsgs = array();

foreach ($f_src_c as $destColumn => $srcColumn) {
	if ($srcColumn == 'NULL') {
		continue;
	}
	$destATF = new ArticleTypeField($f_dest, $destColumn);
	$srcATF = new ArticleTypeField($f_src, $srcColumn);

	if (!$destATF->isConvertibleFrom($srcATF)) {
        $errMsgs[] = getGS('Cannot merge a $1 field ($2) into a $3 field ($4).',
                            getGS($srcATF->getType()), $srcATF->getDisplayName(),
                            getGS($destATF->getType()), $destATF->getDisplayName());
        $ok = false;
	}
}

//
// if f_action is Merge, do the merge and return them to article_types/ screen (or an error)
//
if ($ok && $f_action == 'Merge') {
	if (!SecurityToken::isValid()) {
		camp_html_display_error(getGS('Invalid security token!'));
		exit;
	}