Skip to content

Commit b021618

Browse files
author
Fredrick Peter
committed
New Helpers added - orm_import()
1 parent 162e090 commit b021618

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Prior to installing `php-orm-database` get the [Composer](https://getcomposer.or
104104
**Step 1** — update your `composer.json`:
105105
```composer.json
106106
"require": {
107-
"peterson/php-orm-database": "^3.0.1"
107+
"peterson/php-orm-database": "^3.1.1"
108108
}
109109
```
110110

@@ -1285,6 +1285,7 @@ class PostClass extends DB{
12851285
|---------------------------|-----------------------------------|
12861286
| base_dir() | Return `server` base directory |
12871287
| orm_db() | Return instance of `new DB($options)` class |
1288+
| orm_import() | Return instance of `(new DBImport)` class |
12881289
| orm_migration() | Return instance of `(new Migration)` class |
12891290
| orm_dot_env() | Return instance of `(new OrmDotEnv)` class |
12901291
| autoload_env() | Return instance of `(new AutoloadEnv)` class |

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
"extra": {
3939
"branch-alias": {
40-
"dev-main": "3.0.1-dev"
40+
"dev-main": "3.1.1-dev"
4141
}
4242
},
4343
"minimum-stability": "stable",

src/helpers.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
use builder\Database\DB;
4+
use builder\Database\DBImport;
45
use builder\Database\AutoloadEnv;
56
use builder\Database\Query\MySqlExec;
67
use builder\Database\Schema\OrmDotEnv;
@@ -20,6 +21,18 @@ function orm_db(?array $options = [])
2021
}
2122
}
2223

24+
if (! function_exists('orm_import')) {
25+
/**
26+
* Get Database Import Instance
27+
*
28+
* @return object\builder\Database\DBImport
29+
*/
30+
function orm_import()
31+
{
32+
return (new DBImport);
33+
}
34+
}
35+
2336
if (! function_exists('orm_dot_env')) {
2437
/**
2538
* Get ORM Dot Env

0 commit comments

Comments
 (0)