v0.9.0
<p>Collection items move out of per-item folders into one SQLite database per collection field, which is never in git.</p>
19 October 2026
Added
Phlat\Data\Collection, reached as$app->collection('field'), holds a collection field's items for every page that has the field, indata/pages/_{field}/items.db. It hasget(),find(),count(),sum(),create(),save()anddelete(), andatomic()runs a batch of writes as one transaction. In Latte,{collection('comments')->get($uuid)}replacesitem().- An item belongs to a page by its stored
parentuuid. Moving the page changes nothing, deleting it deletes its items, anduuid:regeneratere-parents them (Collection::reparent()). - Item uuids are unique within a collection, not site-wide, so
new()throwsConflictExceptionon a duplicate in that collection. - An item's files are served at
/_{field}/{shard}/{uuid}/{file}(PageFiles::serveCollection()).V::collectionField()andV::collectionSegment()define the one place a URL path may use_. phlat collection:migratemoves items from the old per-item folders.collection:reindexrebuilds a collection's search tables after its field options change.registry:checkreports collections still in the old layout and items whose page is gone, and--healsweeps them.App::collections()andApp::databases().Db::snapshot()writes a database whole,Db::transaction()takes$immediate, andDir::copy()takes a$skipcallback.
Changed
backup:createanddb:backupsnapshot each collection's database, since collections are never in git and a backup is how they are kept.db:vacuumcovers them too.FieldTypeCollectionis a page's view of the items in its collection.QueryandFieldIndextake the table they work on, so a collection has its own field and search indexes.- Collection items are no longer in the registry (schema 18), and
Registry::locate()looks up pages only. - A page's History is its own files, those directly in its folder. Its log, diff, dirty state and restore no longer include its child pages. Delete and move still take the whole subtree.
Removed
- The
historyoption on collection fields. A collection is never in History. App::item()and theitem()template function, and the item rows,Item::fromRow()andItem::registryKeyFor().
Comments
No comments yet. Be the first!
Loading form…