PHP code example of fivesqrd / atlas-canvas

1. Go to this page and download the library: Download fivesqrd/atlas-canvas 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-canvas example snippets


php vendor/fivesqrd/atlas/scripts/Canvas.php User users id,email,password,lastLogin


namespace Application\Model\User;

class Mapper extends \Atlas\Model\Mapper
{
    protected $_alias = 'u';

    protected $_table = 'users';

    protected $_key = 'id';

    protected $_map = array(
        '_id'        => 'id',
        '_email'     => 'email',
        '_password   => 'password',
        '_lastLogin' => 'last_login'
    );

    protected $_readOnly = array('id');
}

|- Model
   |-- User.php
   |-- User
       |-- Entity.php
       |-- Mapper.php
       |-- Collection.php
       |-- Query.php
       |-- Named.php
       |-- Relation.php
   |-- Customer.php
   |-- Customer
       ...
   |-- Content.php
   |-- Contact
       ...

cd /myproject
mkdir .atlas
cp vendor/fivesqrd/atlas-canvas/scripts/.atlas/canvas.php .atlas/canvas.php
vi .canvas/config.php