Tiger_Model_Page
@api· extendsTiger_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.
$slugstring— the page slug$localestring— the locale to match$orgIdstring— tenant scope ('' = global)$typestring|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.
$keystring— the stable page_key handle$localestring— the locale to match$orgIdstring— tenant scope ('' = global)$typestring|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.
$parentIdstring— the parent page id$localestring— the locale to match$orgIdstring— 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.
$dataarray— page columns to write$pageIdstring|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.)
$pageIdstring— the page id to restore$versionint— the version number to restore
Returns string — the saved page_id
Throws RuntimeException — if the version doesn't exist for the page