
| Current Path : /var/www/html/pallets/web/core/modules/path_alias/src/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/pallets/web/core/modules/path_alias/src/PathAliasStorage.php |
<?php
namespace Drupal\path_alias;
use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
/**
* Defines the storage handler class for path_alias entities.
*/
class PathAliasStorage extends SqlContentEntityStorage {
/**
* {@inheritdoc}
*/
public function createWithSampleValues($bundle = FALSE, array $values = []) {
$entity = parent::createWithSampleValues($bundle, ['path' => '/<front>'] + $values);
// Ensure the alias is only 255 characters long.
$entity->set('alias', substr('/' . $entity->get('alias')->value, 0, 255));
return $entity;
}
}