public static function ReplicationLog::loadOrCreate in Replication 8
Same name and namespace in other branches
- 8.2 src/Entity/ReplicationLog.php \Drupal\replication\Entity\ReplicationLog::loadOrCreate()
Parameters
$id string:
Return value
\Drupal\replication\Entity\ReplicationLogInterface
File
- src/
Entity/ ReplicationLog.php, line 81
Class
- ReplicationLog
- The replication log entity type.
Namespace
Drupal\replication\EntityCode
public static function loadOrCreate($id) {
$entities = \Drupal::entityTypeManager()
->getStorage('replication_log')
->loadByProperties([
'uuid' => $id,
]);
if (!empty($entities)) {
return reset($entities);
}
else {
return static::create([
'uuid' => $id,
]);
}
}