Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Field slugifier id generator #585

Open
wants to merge 2 commits into
base: 2.x
Choose a base branch
from

Conversation

dantleech
Copy link
Contributor

Just an idea of how this might work.

/**
* @group functional
*/
class PhpArrayTest extends \Doctrine\Tests\ODM\PHPCR\PHPCRFunctionalTestCase
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bah .. not part of this PR

@dantleech
Copy link
Contributor Author

After some reflection I think if anything this should be about normalization and not slugification. After all it is perfectly valid to have spaces and non-url-safe characters in a node name.

/**
* Set slugifier callable
*
* PHP callable for peroforming slugification when using the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/peroforming/performing

@dbu
Copy link
Member

dbu commented Dec 27, 2014

hey, cool. i think this is almost ready.

agree that this could be called NormalizedFieldIdGenerator or something. when you want to use the path in a URL, you do want it to be slugified. otherwise you want potentially unsupported characters replaced. and in all cases, you must translate / and the other forbidden characters in a name. documentation should be clear about that. we could provide a very simple normalizer by default that just replaces /:[]|* with -.

@dbu
Copy link
Member

dbu commented Dec 27, 2014

that default normalizer could also get us rid of adding a dependency for a slugifier. we can then explain how to use that instead of the default normalizer in the doc.

@dbu
Copy link
Member

dbu commented Jun 20, 2016

@dantleech something for an upcoming phpcr-odm 2.0? or should we drop this and leave it to other layers of the application to generate ids?

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

Successfully merging this pull request may close these issues.

3 participants