CommentVariablePerCommentType.php in Zircon Profile 8.0
File
core/modules/comment/src/Plugin/migrate/source/d6/CommentVariablePerCommentType.php
View source
<?php
namespace Drupal\comment\Plugin\migrate\source\d6;
class CommentVariablePerCommentType extends CommentVariable {
protected function getCommentVariables() {
$node_types = parent::getCommentVariables();
$return = array();
foreach ($node_types as $node_type => $data) {
if (empty($data['comment_subject_field'])) {
$return['comment'] = array(
'comment_type' => 'comment',
'label' => $this
->t('Default comments'),
'description' => $this
->t('Allows commenting on content'),
);
}
else {
$return['comment_no_subject'] = array(
'comment_type' => 'comment_no_subject',
'label' => $this
->t('Comments without subject field'),
'description' => $this
->t('Allows commenting on content, comments without subject field'),
);
}
}
return $return;
}
public function fields() {
return array(
'comment_type' => $this
->t('The comment type'),
'label' => $this
->t('The comment type label'),
'description' => $this
->t('The comment type description'),
);
}
public function getIds() {
$ids['comment_type']['type'] = 'string';
return $ids;
}
}