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

Gedmo to DoctrineBehaviors 2 migration #2473

Closed
TomasVotruba opened this issue Dec 24, 2019 · 1 comment · Fixed by #2503
Closed

Gedmo to DoctrineBehaviors 2 migration #2473

TomasVotruba opened this issue Dec 24, 2019 · 1 comment · Fixed by #2503

Comments

@TomasVotruba
Copy link
Member

TomasVotruba commented Dec 24, 2019

From: https://github.com/stof/StofDoctrineExtensionsBundle

to: https://github.com/KnpLabs/DoctrineBehaviors


1. Timestampable ✔️

Rename trait:

Gedmo\Timestampable\Traits\Timestampable

Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait

  • add interface: Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface

2. Sluggable ✔️

Replace annotated property with trait

Gedmo\Mapping\Annotation as Gedmo;

- /**
-     * @ORM\Column(type="string", unique=true)
-     * @Gedmo\Slug(fields={"name"})
-     * @var string
-     */
-    private $slug;

remove getSlug()/setSlug()

public function getSlug(): ?string
    {
        return $this->slug;
    }

public function setSlug(?string $slug): void
    {
        $this->slug = $slug;
    }

Add sluggable trait: Knp\DoctrineBehaviors\Model\Sluggable\SluggableTrait

from:

Gedmo\Slug(fields={"name"})

add

/**
 * @return string[]
 */
public function getSluggableFields(): array
{
    return ['name'];
}
@TomasVotruba
Copy link
Member Author

TomasVotruba commented Dec 27, 2019

TomasVotruba added a commit that referenced this issue Jun 10, 2022
TomasVotruba added a commit that referenced this issue Jun 10, 2022
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 a pull request may close this issue.

1 participant