You are here

protected function StockLevelFieldCreationTrait::getFieldname in Commerce Stock 8

Return the field name.

Return value

string The name of the field.

3 calls to StockLevelFieldCreationTrait::getFieldname()
StockLevelFieldCreationTrait::configureFormDisplay in modules/field/tests/src/Kernel/StockLevelFieldCreationTrait.php
Set, update and configure the widget for the stock level field.
StockLevelFieldCreationTrait::configureViewDisplay in modules/field/tests/src/Kernel/StockLevelFieldCreationTrait.php
Set, update and configure the widget for the stock level field.
StockLevelFieldCreationTrait::createStockLevelField in modules/field/tests/src/Kernel/StockLevelFieldCreationTrait.php
Creates a new stock level field.

File

modules/field/tests/src/Kernel/StockLevelFieldCreationTrait.php, line 194

Class

StockLevelFieldCreationTrait
Provides methods to attach and configure a stock level field.

Namespace

Drupal\Tests\commerce_stock_field\Kernel

Code

protected function getFieldname() {
  if (!empty($this->fieldName)) {
    return $this->fieldName;
  }
  return mb_strtolower($this
    ->randomMachineName());
}