Redirect
extends ResourceModel
in package
Redirect Resource
Represents the request object for redirect objects.
Contains a convenience method for simply redirecting to a product or category
$api = new BigCommerce\ApiV3\Client($_ENV['hash'], $_ENV['CLIENT_ID'], $_ENV['ACCESS_TOKEN']);
$productRedirect = new Redirect();
$productRedirect->site_id = 1000;
$productRedirect->from_path = '/cool-product.html';
$productRedirect->toProduct(123);
$api->redirects()->upsert([$productRedirect]);
Tags
Table of Contents
- $from_path : string
- $site_id : int
- $to : RedirectTo
- __construct() : mixed
- jsonSerialize() : array<string|int, mixed>
- toCategory() : void
- toProduct() : void
Properties
$from_path
public
string
$from_path
Tags
$site_id
public
int
$site_id
Tags
$to
public
RedirectTo
$to
Tags
Methods
__construct()
public
__construct([stdClass|null $optionObject = null ]) : mixed
Parameters
- $optionObject : stdClass|null = null
Tags
Return values
mixed —jsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —toCategory()
public
toCategory(int $categoryId) : void
Parameters
- $categoryId : int
Tags
Return values
void —toProduct()
public
toProduct(int $productId) : void
Parameters
- $productId : int