PathAliasStorage.php in Drupal 9
File
core/modules/path_alias/src/PathAliasStorage.php
View source
<?php
namespace Drupal\path_alias;
use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
class PathAliasStorage extends SqlContentEntityStorage {
public function createWithSampleValues($bundle = FALSE, array $values = []) {
$entity = parent::createWithSampleValues($bundle, [
'path' => '/<front>',
] + $values);
$entity
->set('alias', substr('/' . $entity
->get('alias')->value, 0, 255));
return $entity;
}
}