Skip to content

[RFC]: Standardise Constraint Naming in Metadata Source #151

Open

Description

@simon-mundy

Proposed Version

0.6.0

Basic Information

Provide a mechanism for a component-wide standardisation of constraint naming. Currently 'laminas' is prepended to a constraint name across multiple adapters in the \MetaData\Source. Instead we should enforce this from within PhpDb\Metadata\Source\AbstractSource and allow this to be changed at a global level if desired.

Background

_laminas_ key was hardcoded to the file.

Considerations

Not a huge impact, other than to see that it is legacy.

Proposal(s)

protected string $constraintPrefix = '';

public function setConstraintPrefix(string $prefix): void
{
    // Ensure alphanumeric and remove leading/trailing underscore
}

protected function getResolvedConstraintPrefix(): string
{
    return '_' . $this->constraintPrefix . '_';
}

### Appendix/Additional Info

_No response_

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions