Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Commit

Permalink
new version
Browse files Browse the repository at this point in the history
  • Loading branch information
rez1dent3 committed Feb 8, 2017
1 parent dc9b6e7 commit 67d0411
Show file tree
Hide file tree
Showing 138 changed files with 1,394 additions and 34,405 deletions.
14 changes: 0 additions & 14 deletions bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
<?php

include_once __DIR__ . '/vendor/autoload.php';
include_once __DIR__ . '/models.php';

\Deimos\ORM\Connection::setConfig([
'default' => [
'dsn' => 'mysql:host=localhost;dbname=auto_dev',
'username' => 'root',
'password' => ''
],
'sphinx' => [
'dsn' => 'mysql:host=localhost:9306',
'username' => '',
'password' => ''
],
]);
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"orm",
"database"
],
"homepage": "https://github.com/REZ1DENT3/DeimosORM",
"homepage": "https://github.com/DeimosProject/ORM",
"license": "MIT",
"type": "library",
"authors": [
Expand All @@ -17,11 +17,11 @@
],
"require": {
"php": "^5.6 || ^7.0",
"doctrine/inflector": "~1.0"
"doctrine/inflector": "~1.0",
"deimos/database": "^0.0"
},
"require-dev": {
"phpunit/phpunit": "5.7.5",
"codeclimate/php-test-reporter": "dev-master"
"phpunit/phpunit": "5.7.5"
},
"autoload": {
"psr-4": {
Expand Down
172 changes: 0 additions & 172 deletions configs/sphinx.conf

This file was deleted.

12 changes: 0 additions & 12 deletions demo/array.php

This file was deleted.

11 changes: 0 additions & 11 deletions demo/json.php

This file was deleted.

27 changes: 0 additions & 27 deletions demo/one2many.php

This file was deleted.

11 changes: 0 additions & 11 deletions demo/orderByRand.php

This file was deleted.

33 changes: 0 additions & 33 deletions demo/sphinx.php

This file was deleted.

49 changes: 49 additions & 0 deletions demo/test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

include_once dirname(__DIR__) . '/vendor/autoload.php';

class User extends \Deimos\ORM\Entity
{

}

$builder = new \Deimos\Builder\Builder();

$configObject = new \Deimos\Config\ConfigObject($builder, [
'adapter' => 'mysql',
// 'host' => 'localhost', // optional
// 'port' => 3306, // optional
'database' => 'test',
'username' => 'root',
'password' => ''
]);

$database = new \Deimos\Database\Database($configObject);

$orm = new \Deimos\ORM\ORM($database);

//$orm->register('user', User::class/*, [
// 'role' => [
// 'type' => 'manyToMany',
//
//
//
// 'table' => 'usersRoles',
//
// 'left' => 'user',
// 'right' => 'role',
// ]
//]*/);

$user = $orm->repository('user')
->orderBy('id', 'DESC')
->findOne();

var_dump($user);

//$orm->create('user')->save([
// 'first_name' => 'test',
// 'last_name' => 'test',
//]);

var_dump($orm->repository('user')->count());
Loading

0 comments on commit 67d0411

Please sign in to comment.