Tiger_Model_Page

@api Β· extends Tiger_Model_Table

Page β€” the CMS content store (see migration 0014).

One model for all three rendering primitives (type): page (routed by slug), layout (chrome), partial (fragment). Resolution honors the tenant cascade (org row wins over global '') and, for pages, the publish + schedule gate.

Rendering itself (turning body into HTML via the format + a view context) is the CMS service's job, on top of the non-file Zend_View enhancement β€” this model is the data gateway.

Methods

resolveBySlug()

resolveBySlug($slug, $locale, $orgId = '', $type = null)

Resolve a live page by slug for an org. Walks org_id IN (current, '') and the TENANT row wins over global; only published rows whose schedule has arrived. Returns the row or null.

  • $slug string β€” the page slug
  • $locale string β€” the locale to match
  • $orgId string β€” tenant scope ('' = global)
  • $type string|null β€” restrict to a TYPE_* constant, or null for any

Returns Zend_Db_Table_Row_Abstract|null β€” the live page row, or null

fetchByKey()

fetchByKey($key, $locale, $orgId = '', $type = null)

Fetch by stable handle (layouts, partials, or a page by key). Not publish- gated β€” layouts/partials are infrastructure, fetched regardless of status. Tenant row wins over global.

  • $key string β€” the stable page_key handle
  • $locale string β€” the locale to match
  • $orgId string β€” tenant scope ('' = global)
  • $type string|null β€” restrict to a TYPE_* constant, or null for any

Returns Zend_Db_Table_Row_Abstract|null β€” the row, or null

children()

children($parentId, $locale, $orgId = '')

All published pages under a parent, ordered β€” for nav/menus.

  • $parentId string β€” the parent page id
  • $locale string β€” the locale to match
  • $orgId string β€” tenant scope ('' = global)

Returns Zend_Db_Table_Rowset_Abstract β€” the ordered child pages

save()

save(array $data, $pageId = null)

Save a page (insert or update) AND snapshot the result to page_version. When an existing page's slug changes, a page_redirect (old -> new) is recorded so the old URL 301s. Wrapped in a transaction. Returns the page_id.

  • $data array β€” page columns to write
  • $pageId string|null β€” update this page, or null to insert a new one

Returns string β€” the saved page_id

Throws Throwable β€” on a DB failure (the transaction is rolled back and rethrown)

restoreVersion()

restoreVersion($pageId, $version)

Restore a page to a prior version β€” copies that version's content back onto the page (which snapshots as a new version). Returns the page_id. (Named restoreVersion to avoid Tiger_Model_Table::restore(), the soft-delete undelete.)

  • $pageId string β€” the page id to restore
  • $version int β€” the version number to restore

Returns string β€” the saved page_id

Throws RuntimeException β€” if the version doesn't exist for the page