Skip to content

Conversation

@jswift
Copy link
Collaborator

@jswift jswift commented Jul 1, 2021

Adding redirect targets was a bit long and annoying, so I made a simple version

Previously...

$redirect = new Redirect();
$redirect->from_path = "/old-url/$i";
$redirect->site_id   = 0;

$redirectTo = new RedirectTo();
$redirectTo->type      = RedirectTo::TYPE__PRODUCT;
$redirectTo->entity_id = 123;

$redirect->to = redirectTo;

Now...

$redirect = new Redirect();
$redirect->from_path = "/old-url/$i";
$redirect->site_id   = 0;
$redirect->toProduct(123);

@jswift jswift requested a review from AdamJHall July 1, 2021 00:18
@jswift jswift merged commit 5a92e65 into main Jul 1, 2021
@jswift jswift deleted the feature/redirect-convenicence-method branch July 8, 2021 00:37
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.

3 participants