1. Go to this page and download the library: Download fivesqrd/atlas-foundation 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/ */
fivesqrd / atlas-foundation example snippets
$user = new Model\User\Entity();
$user->set('_email', '[email protected]');
$user->set('_enabled', true);
/* Save to db */
$id = $this->model(Model\User::class)->save($user);
/* Fetch from db */
$user = $this->model(Model\User::class)->fetch($id);
/* Update entity */
$user->set('_lastLogin', time());
/* Save to db */
$this->model(Model\User::class)->save($user);
$users = $this->model(Model\User::class)->query()
->isEnabled(true)
->hasLoggedSince(strtotime('5 days ago'))
->fetch()->all();
foreach ($users as $user) {
echo $user->get('_email');
}
/* Fetch from db */
$user = $this->model(Model\User::class)->fetch($id);
/* Update entity */
$user->setEmailAddress('[email protected]');
$user->setEnabled(true);
/* Save to db */
$this->model(Model\User::class)->save($user);