You are here

function _pathauto_get_schema_alias_maxlength in Pathauto 6

Same name and namespace in other branches
  1. 6.2 pathauto.inc \_pathauto_get_schema_alias_maxlength()
  2. 7 pathauto.inc \_pathauto_get_schema_alias_maxlength()

Fetch the maximum length of the {url_alias}.dst field from the schema.

Return value

An integer of the maximum URL alias length allowed by the database.

5 calls to _pathauto_get_schema_alias_maxlength()
PathautoUnitTestCase::testGetSchemaAliasMaxLength in ./pathauto.test
Test _pathauto_get_schema_alias_maxlength().
pathauto_admin_settings in ./pathauto.admin.inc
Form builder; Configure the Pathauto system.
pathauto_cleanstring in ./pathauto.inc
Clean up a string segment to be used in an URL alias.
pathauto_clean_alias in ./pathauto.inc
Clean up an URL alias.
pathauto_create_alias in ./pathauto.inc
Apply patterns to create an alias.

File

./pathauto.inc, line 671
Miscellaneous functions for Pathauto.

Code

function _pathauto_get_schema_alias_maxlength() {
  static $maxlength;
  if (!isset($maxlength)) {
    $schema = drupal_get_schema('url_alias');
    $maxlength = $schema['fields']['dst']['length'];
  }
  return $maxlength;
}