PHP code example of minifast / minifast-orm

1. Go to this page and download the library: Download minifast/minifast-orm 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/ */

    

minifast / minifast-orm example snippets



$user = new User();
$user
    ->setPseudo('iTechCydia')
    ->setEmail('[email protected]')
    ->setPassword(hash('whirlpool', 'theUserSecretPassword'))
    ->setDate(time())
    ->save();


$user = new UserQuery::create()
    ->limit(10)
    ->offset(3)
    ->findAll();


$user = new UserQuery::create()
    ->findPK(23);


$user = new UserQuery::create()
    ->findPKs([23, 24, 25]);


$user = new UserQuery::create()
    ->findByPseudo('iTechCydia')
    ->find();


$user = UserQuery::create()
    ->filterById(23)
    ->setNewsletter(true)
    ->setEmailPublic(false)
    ->setEmail('[email protected]')
    ->save(); // Don't forget to save!


$user = UserQuery::create()
    ->delete(true);

$user = UserQuery::create()
    ->filterByNewsletter(false) // bad users :p
    ->delete();
bash
$ php vendor/minifast/minifast-orm/init.php /path/to/schema.xml