本文整理汇总了PHP中Drupal\field\Entity\FieldStorageConfig::getBundles方法的典型用法代码示例。如果您正苦于以下问题:PHP FieldStorageConfig::getBundles方法的具体用法?PHP FieldStorageConfig::getBundles怎么用?PHP FieldStorageConfig::getBundles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\field\Entity\FieldStorageConfig
的用法示例。
在下文中一共展示了FieldStorageConfig::getBundles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildRow
/**
* XXXXX.
* @param \Drupal\field\Entity\FieldStorageConfig $field_storage.
* @return array
* xxx
*/
protected function buildRow(FieldStorageConfig $field_storage)
{
$row = [];
if ($field_storage->isLocked()) {
$row[0]['class'] = array('menu-disabled');
$row[0]['data']['id'] = $this->t('@field_name (Locked)', array('@field_name' => $field_storage->getName()));
} else {
$row[0]['data'] = $field_storage->getName();
}
$row[1]['data'] = $field_storage->getType();
$row[2]['data'] = $field_storage->getTargetEntityTypeId();
$row[3]['data'] = implode(",", $field_storage->getBundles());
$default_type = $this->fieldPermissions->fieldGetPermissionType($field_storage);
if ($default_type == FIELD_PERMISSIONS_PUBLIC) {
$row[4]['data'] = t("Public field (author and administrators can edit, everyone can view)");
$row[4]['colspan'] = 5;
} elseif ($default_type == FIELD_PERMISSIONS_PRIVATE) {
$row[4]['data'] = t("Private field (only author and administrators can edit and view)");
$row[4]['colspan'] = 5;
} elseif ($default_type == FIELD_PERMISSIONS_CUSTOM) {
$row[4]['data'] = t("Custom field Permission ()");
$row[4]['colspan'] = 5;
}
return $row;
}