1. Go to this page and download the library: Download atlas/transit library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$transit = Transit::new(
Atlas::new('sqlite::memory:'),
'App\\DataSource\\', // data source namespace
);
// select records from the mappers to create entities and collections
$thread = $transit
->select(Thread::CLASS) // the domain class
->where('id = ', 1)
->fetchDomain();
$responses = $transit
->select(Responses::CLASS) // the domain class
->where('thread_id IN ', [2, 3, 4])
->fetchDomain();
// do stuff to $thread and $responses
// then plan to save/update all of $responses ...
$transit->store($responses);
// ... and plan to delete $thread
$transit->discard($thread);
// finally, persist all the domain changes in Transit
$success = $transit->persist();