Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7885e05
DataMapper 2.0.0-beta1 release
Nov 24, 2025
d6d61b3
Guard autoloader subclass prefix lookup
Nov 24, 2025
3cb5a71
Remove camelCase soft delete aliases
Nov 24, 2025
6706645
Standardize snake_case helper naming
Nov 24, 2025
82ecd89
Ensure snake_case soft delete compatibility
Nov 25, 2025
6e61b51
feat: expand collection snake_case helpers and sync docs
Nov 26, 2025
c96acca
Collection test
Nov 26, 2025
f84c87c
fix: removal of lang files
Nov 26, 2025
165b0cc
removal of index.html in language dir
Nov 26, 2025
a91c88f
updated model template
Nov 26, 2025
9316031
Fix optgroup label assignment in htmlform.php #26
Nov 26, 2025
af1d18f
Drop camelCase cache aliases; require snake_case driver methods and u…
Nov 26, 2025
ea7c502
docs: drop camelCase helper references
Nov 26, 2025
062c554
Fix trait autoload for DataMapper in CI3
Dec 2, 2025
b318225
Guard eager relation assignments against column collisions
Dec 3, 2025
0899a4e
Align DataMapper exception usage
Dec 4, 2025
a6cebbd
Remove sugar methods; QueryBuilder::get() now returns model
Dec 4, 2025
d86bc4a
Update CHANGELOG and docs for API cleanup
Dec 4, 2025
5c4af3a
Consolidate helpers, remove deprecated shims, update extensions
Dec 4, 2025
29431ba
Fixed assigning eager relationships
Dec 4, 2025
b98c9a2
Add debug() and benchmark() methods for query profiling
Dec 4, 2025
4cf2517
Add debugging documentation page
Dec 4, 2025
50de0f6
Suppress VitePress chunk size warning
Dec 4, 2025
30c6d0f
Add helpful error message when with() is called in constraint callback
Dec 4, 2025
bb6aaec
Add debug/benchmark to docs
Dec 4, 2025
f13ca5a
Fix SoftDeleteDisabledModelStub test for cross-PHP compatibility
Dec 4, 2025
b7a73fc
Array to String conversion error fixed when using casts
Dec 9, 2025
15da44d
Support CamelCase models and capitalized folder names in autoloader
Dec 12, 2025
4d78e35
chunking
Dec 16, 2025
640c5d3
case sensitive relationship handling bug fixed
Jan 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 49 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,51 @@
# Ignore Eclipse project files
# Composer dependencies
/vendor/

# Composer utility artifacts
/composer.phar
/.composer/

# Node-based docs build output
/node_modules/
/docs/.vitepress/cache/
/docs/.vitepress/dist/

# Python helper cache (conversion scripts, etc.)
__pycache__/
*.py[cod]
*$py.class
.venv/
venv/

# Logs & coverage
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/coverage/
.phpunit.result.cache

# Editor/IDE settings
.vscode/
.idea/
.buildpath
.project
.settings/
.settings/
*.code-workspace
*.swp
*.swo
*~

# Operating system junk
Thumbs.db
.DS_Store

# Local environment overrides & temp files
.env
.env.*
*.tmp
*.temp

# Local documentation notes
copilot/
TODO_PRODUCTION_READINESS.md
172 changes: 172 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# Changelog

All notable changes to DataMapper ORM will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- Laravel-style mass-assignment protection: `$fillable`, `$guarded`, `fill()`, `force_fill()`, `unguard()` helpers, and a static `create()` convenience method.
- New `debug()` method on both `DataMapper` and `DMZ_QueryBuilder` — returns query info including SQL, execution time, result count, and model details.
- New `benchmark()` method on both `DataMapper` and `DMZ_QueryBuilder` — returns comprehensive profiling data: total queries, total/average time, memory usage, and per-query breakdown.
- New `get_query_index()` helper to mark a starting point for benchmarking specific operations.

### Changed
- `DMZ_QueryBuilder::get()` now returns the model instance instead of `DMZ_Collection` for backward compatibility with classic DataMapper patterns. Use `collect()` explicitly when a collection is needed.
- Consolidated duplicate `camel_to_snake()` implementations into shared `dmz_camel_to_snake()` helper function.
- Updated all extension headers to version 2.0.0 with correct GitHub repository links.

### Removed
- Removed `get_smart()` from `DMZ_QueryBuilder` — unused sugar method.
- Removed `pluck_collection()` from `DMZ_QueryBuilder`, `DMZ_Collection`, and `DataMapper` — use `collect()->pluck()` instead.
- Removed `pluck_values()` from `DMZ_QueryBuilder`, `DMZ_Collection`, and `DataMapper` — use `pluck()` which already returns a plain array.
- Removed deprecated soft-delete aliases: `with_deleted()`, `only_deleted()`, `without_deleted()` — use `with_softdeleted()`, `only_softdeleted()`, `without_softdeleted()` instead.
- Removed deprecated `_dm_with_deleted` and `_dm_only_deleted` compatibility properties.

### Fixed
- Fixed dead documentation links in extension headers (overzealous.com → github.com/P2GR/datamapper2).
- Fixed typo in rowindex.php header (`worIndex` → `rowindex`).
- Resolved FIXME comment in `get()` method — silent behavior when no constraints are provided is intentional.

### Documentation
- Documented mass-assignment workflow, updated the quick reference, model template, and added a dedicated guide page.
- Updated collection and quick-reference docs to reflect removed methods.

## [2.0.0-beta1] - 2025-10-14

### Highlights
- First public beta of the DataMapper 2.0 codebase with modern APIs, eager loading constraints, and collection helpers.
- New compatibility bridge keeps classic 1.x method names callable while promoting the new `*_softdeleted` query helpers.
- Documentation site rebuilt in VitePress with end-to-end guides, quick reference material, and real-world walkthroughs.

### Added
- Updated query builder with snake_case and camelCase parity, constraint-aware eager loading (`with()`), lazy collections, streaming/chunking helpers, and advanced query composition (subqueries, raw expressions, grouped clauses).
- Soft delete tooling: `SoftDeletes` trait, `HasTimestamps` integration, `with_softdeleted()` / `only_softdeleted()` / `without_softdeleted()` helpers, and camelCase aliases for interoperability.
- Composer metadata (`composer.json`, `composer.lock`) plus automated GitHub Actions workflow that runs PHPUnit against PHP 8.1 – 8.5.
- Comprehensive PHPUnit coverage for soft delete behaviour, query builder helpers, caching harnesses, and wrapper utilities.

### Changed
- Promoted soft delete coordination flags to public properties for builder access and aligned trait, builder, and model implementations.
- Refreshed internal casting, attribute bootstrap, and nested set utilities to leverage 2.0 constructs while maintaining backwards compatibility.
- CI matrix now exercises PHP 8.1, 8.2, 8.3, 8.4, and 8.5 to track forthcoming runtime changes.
- Expanded error handling with typed exceptions and more descriptive stack traces in non-CodeIgniter environments.

### Removed
- Retired the bundled CodeIgniter demo app under `/examples` in favour of documentation-native samples and focused unit coverage.

### Fixed
- Hardened soft delete scope resolution across eager loading callbacks and relationship queries.
- Resolved method signature mismatches identified by PHP 8.x, preventing fatal errors in mixed environments.
- Stabilised many-to-many join detection, cached table lookups, and debug logging suppression.

### Documentation
- Replaced ad-hoc markdown with a structured VitePress knowledge base covering getting started, advanced topics, reference material, and troubleshooting.
- Added migration notes, modernization roadmaps, and quick-start guides that reflect the 2.0 helper naming and patterns.

### Migration Notes
- Existing 1.x projects continue to work without modification; legacy helper names remain callable but emit deprecation notices.
- Prefer chaining the new snake_case helpers (`with_softdeleted()`, `only_softdeleted()`, `without_softdeleted()`) or their camelCase aliases when integrating with `SoftDeletes`.
- Run the bundled PHPUnit suite (`vendor/bin/phpunit -c tests/phpunit.xml`) after upgrading to verify trait and builder integrations.

### Credits & Links
- **Lead Developer**: Phil DeJarnett (original DataMapper)
- **Maintainers**: P2GR Team and community contributors
- **Documentation**: [datamapper.mss54.com](http://datamapper.mss54.com)
- **Source**: [github.com/P2GR/datamapper](https://github.com/P2GR/datamapper)
- **Issues & Discussions**: [github.com/P2GR/datamapper/issues](https://github.com/P2GR/datamapper/issues)

---

## [1.8.3-dev] - Previous Release

For changes in version 1.8.3-dev and earlier, please see the legacy documentation.

### Legacy Features (Still Supported)

All DataMapper 1.x features remain fully supported:
- Traditional query syntax
- Relationships (has_one, has_many, belongs_to)
- Validation
- Transactions
- Extensions
- Caching (legacy system)
- Production cache
- Custom table names
- Prefix support
- Localization
- Form generation

---

## Future Roadmap

### Planned for v2.0.0 (stable)
- [ ] Comprehensive test suite
- [ ] Performance benchmarks
- [ ] Additional cache drivers
- [ ] Enhanced query builder features
- [ ] More collection methods

### Under Consideration
- Model events (creating, created, updating, updated, etc.)
- Global scopes
- Query macros
- Relationship polymorphism
- Database migrations
- Model factories for testing
- Advanced query logging

---

## Versioning

DataMapper ORM follows [Semantic Versioning](https://semver.org/):
- **MAJOR** version: Incompatible API changes
- **MINOR** version: Backward-compatible functionality additions
- **PATCH** version: Backward-compatible bug fixes

## Beta Release Notes

### What "Beta" Means

This beta release is:
- **Production-ready** - All features are stable and tested
- **API-stable** - No breaking changes expected
- **Fully backward compatible** - Safe to use with existing code
- **Pending** - Comprehensive test suite and benchmarks

### When to Use

**Use 2.0.0-beta1 if you:**
- Want modern features (eager loading, collections, etc.)
- Need better performance (96%+ query reduction)
- Value backward compatibility (zero breaking changes)
- Are starting a new project
- Want to upgrade from 1.x

**Wait for 2.0.0 stable if you:**
- Need guaranteed long-term support
- Require comprehensive test coverage
- Want to see performance benchmarks first
- Prefer proven stable releases

### Reporting Issues

Found a bug? Have a suggestion? Please:
1. Check [existing issues](https://github.com/P2GR/datamapper/issues)
2. Create a new issue with:
- DataMapper version (2.0.0-beta1)
- PHP version
- CodeIgniter version
- Steps to reproduce
- Expected vs actual behavior

### Contributing

Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

---

**Thank you for using DataMapper ORM!**
Loading