atlas / mapper
A data mapper for the persistence model.
Installs: 55 367
Dependents: 3
Suggesters: 0
Security: 0
Stars: 7
Watchers: 4
Forks: 8
Open Issues: 4
Requires
- php: >=7.1.0
- atlas/table: ~1.0
Requires (Dev)
- atlas/testing: ~1.0
- pds/skeleton: ~1.0
- phpunit/phpunit: ~7.0
This package is auto-updated.
Last update: 2024-10-25 15:45:57 UTC
README
A data mapper implementation for Atlas. Though it is primarily intended as the heart of Atlas.Orm, it may be used independently of that package.
Getting Started
First, you will need to create the prerequsite data-source classes using Atlas.Cli 2.x.
Once you have done so, create a MapperLocator using the static new()
method
and pass your PDO connection parameters:
use Atlas\Table\MapperLocator; $mapperLocator = MapperLocator::new('sqlite::memory:'')
You can then use the locator to retrieve a Mapper by its class name.
use Atlas\Testing\DataSource\Thread\ThreadMapper; $threadMapper = $mapperLocator->get(ThreadMapper::CLASS)
From there you can fetch, insert, update, delete, and persist Record objects.
In the absence of full documentation, please review these Mapper methods instead:
- fetchRecord()
- fetchRecordBy()
- fetchRecords()
- fetchRecordsBy()
- fetchRecordSet()
- fetchRecordSetBy()
- select()
- insert()
- update()
- delete()
- persist()