Skip to content
Snippets Groups Projects

Issue #3455416: Resolved the machine_name error and applied the mentioned changes.

1 file
+ 0
26
Compare changes
  • Side-by-side
  • Inline
+ 0
26
@@ -560,32 +560,6 @@ public function getDerivativeId() {
return $this->get('uuid')->value;
}
/**
* {@inheritdoc}
*/
public function getMachineName() {
return $this->get('machine_name')->value;
}
/**
* Checks that an existing machine name does not already exist.
*
* This is a static mehod so it can be used by a machine name field.
*
* @param string $machine_name
* The machine name to load the entity by.
*
* @return \Drupal\colossal_menu\Entity\Link|null
* Loaded Link entity or NULL if not found.
*/
public static function loadByMachineName($machine_name) {
$storage = \Drupal::service('entity_type.manager')->getStorage('colossal_menu_link');
$result = $storage->getQuery()
->condition('machine_name', $machine_name)
->execute();
return $result ? $storage->loadMultiple($result) : [];
}
/**
* Get the database connection.
*
Loading