Micro-ORM/tests/ModelTests.php

29 lines
567 B
PHP

<?php
require_once __DIR__ . '/../vendor/autoload.php';
use Fufle\Demo\Model\Job;
use Fufle\ORM\Database\ConnectionManager;
use Fufle\ORM\Database\Connectors\PostgresConnector;
//$dns = 'pgsql:host=localhost;port=5432;dbname=dynamic;user=dynamic;password=password123';
$params = [
'pgsql',
'localhost',
5432,
'dynamic_dev',
'dynamic',
'Pass@Dyna21',
];
ConnectionManager::RegisterConnector(new PostgresConnector());
ConnectionManager::Connect(...$params);
echo "
";
var_dump(Job::GetLast10());
echo "
";
var_dump(Job::Get(10));
echo "
";