atlas/mapper
Atlas.Mapper is a lightweight data mapper for Atlas, used as the core of Atlas.Orm or standalone. Create a MapperLocator with PDO params, fetch mappers by class, and work with Records via select, fetch, insert, update, delete, and persist.
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.
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:
How can I help you explore Laravel packages today?