Micro-ORM/tests/ModelTests.php

30 lines
615 B
PHP
Raw Permalink Normal View History

2021-02-27 23:04:16 +00:00
<?php
require_once __DIR__ . '/../vendor/autoload.php';
2021-03-01 15:06:02 +00:00
use Fufle\Demo\Model\Job;
2021-03-07 10:30:13 +00:00
//use Fufle\ORM\Database\ConnectionManager;
2021-03-07 08:39:13 +00:00
use Fufle\ORM\Database\Connectors\PostgresConnector;
2021-02-27 23:04:16 +00:00
2021-03-07 00:15:16 +00:00
//$dns = 'pgsql:host=localhost;port=5432;dbname=dynamic;user=dynamic;password=password123';
$params = [
2021-03-07 10:30:13 +00:00
// 'pgsql',
2021-03-07 00:15:16 +00:00
'localhost',
5432,
'dynamic_dev',
'dynamic',
2021-03-07 10:12:43 +00:00
'Pass@Dyna21',
2021-03-07 00:15:16 +00:00
];
2021-03-07 10:30:13 +00:00
PostgresConnector::Connect(...$params);
//ConnectionManager::RegisterConnector(new PostgresConnector());
//ConnectionManager::Connect(...$params);
2021-02-27 23:04:16 +00:00
echo "
";
2021-03-01 15:06:02 +00:00
var_dump(Job::GetLast10());
2021-02-27 23:04:16 +00:00
echo "
2021-02-28 00:06:51 +00:00
";
2021-03-01 15:06:02 +00:00
var_dump(Job::Get(10));
2021-02-28 00:06:51 +00:00
echo "
2021-02-27 23:04:16 +00:00
";