Tiger_Model_PageRedirect

@api · extends Tiger_Model_Table

PageRedirect — slug-change redirects (see migration 0016).

When a published page's slug changes, a row here 301s the old URL to the new one so links and SEO survive. Read by Tiger_Controller_Plugin_PageDispatch on a miss. Tenant-scoped like pages (org cascade: a tenant row wins over global '').

Methods

findFrom()

findFrom($fromSlug, $locale, $orgId = '')

The redirect for a retired slug, or null (tenant row wins over global).

  • $fromSlug string — the retired (old) slug
  • $locale string — the locale to match
  • $orgId string — tenant scope ('' = global)

Returns Zend_Db_Table_Row_Abstract|null — the redirect row, or null

add()

add($fromSlug, $toSlug, $locale, $orgId = '', $code = 301)

Record a redirect (call on a slug change). Returns the id.

  • $fromSlug string — the old slug to redirect from
  • $toSlug string — the new slug to redirect to
  • $locale string — the locale to match
  • $orgId string — tenant scope ('' = global)
  • $code int — the HTTP redirect status code

Returns string — the page_redirect_id

clearFrom()

clearFrom($fromSlug, $locale, $orgId = '')

Remove any redirect pointing FROM a slug (e.g. a live page reclaims it).

  • $fromSlug string — the slug to clear redirects from
  • $locale string — the locale to match
  • $orgId string — tenant scope ('' = global)

Returns int — the number of rows deleted