Skip to content

atlasphp/Atlas.Mapper

1.x
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Atlas.Mapper

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()

About

A data mapper implementation for the persistence model.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages