本文整理匯總了PHP中Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseFieldDefinition::createFromFieldStorageDefinition方法的具體用法?PHP BaseFieldDefinition::createFromFieldStorageDefinition怎麽用?PHP BaseFieldDefinition::createFromFieldStorageDefinition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Drupal\Core\Field\BaseFieldDefinition
的用法示例。
在下文中一共展示了BaseFieldDefinition::createFromFieldStorageDefinition方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getFieldDefinition
/**
* Gets the field definition.
*
* A View works on an entity type across bundles, and thus only has access to
* field storage definitions. In order to be able to use widgets and
* formatters, we create a generic field definition out of that storage
* definition.
*
* @see BaseFieldDefinition::createFromFieldStorageDefinition()
*
* @return \Drupal\Core\Field\FieldDefinitionInterface
* The field definition used by this handler.
*/
protected function getFieldDefinition()
{
if (!$this->fieldDefinition) {
$field_storage_config = $this->getFieldStorageDefinition();
$this->fieldDefinition = BaseFieldDefinition::createFromFieldStorageDefinition($field_storage_config);
}
return $this->fieldDefinition;
}