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

Added sluggable trait #10

Merged
merged 3 commits into from
Aug 22, 2012
Merged

Added sluggable trait #10

merged 3 commits into from
Aug 22, 2012

Conversation

daviddesberg
Copy link
Contributor

Added a sluggable trait for generating slugs on entities.

David Desberg added 2 commits July 21, 2012 09:23
* Added documentation for that trait
* Added listener for trait and added listener to orm-services.yml
}

$sluggableText = implode($usableValues, ' ');
$this->slug = \Knp\DoctrineBehaviors\ORM\Sluggable\Util\SlugGenerator::urlize($sluggableText, $this->getSlugDelimiter() );
Copy link
Contributor

Choose a reason for hiding this comment

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

use a slugifier trait, so that you can do $this->slugify, instead of using hell static methods :)

@daviddesberg
Copy link
Contributor Author

Heh, fair point. Still not used to using traits, I'll update later today :)

@daviddesberg
Copy link
Contributor Author

@gquemener Done.

docteurklein added a commit that referenced this pull request Aug 22, 2012
@docteurklein docteurklein merged commit 0bfe957 into KnpLabs:master Aug 22, 2012
@docteurklein
Copy link
Contributor

thanks!

@trsteel88
Copy link
Contributor

Is it possible to have annotation validation on the slug or do we need to put them in validation.yml because you can't override a variable?

Also, how can you then override the ORM annotation (eg make the column unique, change the column name)?

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

Successfully merging this pull request may close these issues.

4 participants