Skip to content

Commit 7b640c1

Browse files
Merge pull request #97 from dimitriBouteille/update-doc
Update doc
2 parents 223c5c8 + 3e6728d commit 7b640c1

8 files changed

+11
-269
lines changed

.php-cs-fixer.php

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
'no_unused_imports' => true,
4141
'align_multiline_comment' => true,
4242
'array_indentation' => true,
43+
'blank_line_after_opening_tag' => false,
4344
'header_comment' => [
4445
'header' => $header,
4546
'comment_type' => 'PHPDoc',

README.md

+9-17
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,29 @@
55
WordPress ORM with Eloquent is a small library that adds a basic ORM into WordPress, which is easily extendable and includes models for core WordPress models such as posts, post metas, users, comments and more.
66
The ORM is based on [Eloquent ORM](https://laravel.com/docs/eloquent) and uses the WordPress connection (`wpdb` class).
77

8-
> 💡 To simplify the integration of this library, we recommend using WordPress with one of the following tools: [Bedrock](https://roots.io/bedrock/), [Themosis](https://framework.themosis.com/) or [Wordplate](https://github.com/wordplate/wordplate#readme).
8+
> [!TIP]
9+
> To simplify the integration of this library, we recommend using WordPress with one of the following tools: [Bedrock](https://roots.io/bedrock/), [Themosis](https://framework.themosis.com/) or [Wordplate](https://github.com/wordplate/wordplate#readme).
910
10-
### Features
11+
## Features
1112

1213
- ✅ Support core WordPress models: `Comment`, `Option`, `Post`, `TermTaxonomy`, `Term`, `User`, `PostMeta` and `UserMeta`
1314
- ✅ Support core WordPress post type: `Article`, `Attachment` and `Page`
1415
- ✅ Based on core WordPress database connection (`wpdb` class), no configuration required !
1516
- ✅ Custom functions to filter models with meta
16-
- ❤️ Easy integration of a custom post type
17+
- ✅ Meta casting (e.g. [Attribute Casting](https://laravel.com/docs/eloquent-mutators#attribute-casting))
18+
- ❤️ Easy integration of a custom post and comment type
1719
- ❤️ Easy model creation for projects with custom tables
1820
- ❤️ All the features available in Eloquent, are usable with this library !
1921

2022
**Not yet developed but planned in a future version:**
2123

22-
- 🗓️ Create custom comment type
23-
- 🗓️ Meta casting (e.g. [Attribute Casting](https://laravel.com/docs/10.x/eloquent-mutators#attribute-casting))
24+
- 🗓️ [Create migration tool with Eloquent](https://github.com/dimitriBouteille/wp-orm/issues/28)
2425

25-
### Documentation
26+
## Documentation
2627

27-
This documentation only covers the specific points of this library, if you want to know more about Eloquent, the easiest is to look at [the documentation of Eloquent](https://laravel.com/docs/10.x/eloquent) :)
28+
This documentation only covers the specific points of this library, if you want to know more about Eloquent, the easiest is to look at [the documentation of Eloquent](https://laravel.com/doc/eloquent).
2829

29-
- [Installation](#installation)
30-
- [Use WordPress core models](doc/wordpress-core-models.md)
31-
- [Filter data](/doc/filter-data.md)
32-
- [With findOneBy*](/doc/filter-data.md#with-findoneby)
33-
- [With taps](/doc/filter-data.md#with-taps)
34-
- [With query builder](/doc/filter-data.md#with-query-builder)
35-
- [Events](/doc/events.md)
36-
- [Create custom model](doc/create-model.md)
37-
- [Generic Model](doc/create-model.md#generic-model)
38-
- [Custom Post Type Model](doc/create-model.md#custom-post-type-model)
30+
You can find all the documentation in [the wiki](https://github.com/dimitriBouteille/wp-orm/wiki).
3931

4032
## Installation
4133

doc/available-filters.md

-25
This file was deleted.

doc/create-model.md

-63
This file was deleted.

doc/events.md

-58
This file was deleted.

doc/filter-data.md

-86
This file was deleted.

doc/wordpress-core-models.md

-19
This file was deleted.

src/Orm/Database.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public function transaction(\Closure $callback, $attempts = 1)
255255
// We'll simply execute the given callback within a try / catch block and if we
256256
// catch any exception we can rollback this transaction so that none of this
257257
// gets actually persisted to a database or stored in a permanent fashion.
258-
$data = $callback();
258+
$data = $callback($this);
259259
$this->commit();
260260
return $data;
261261
} catch (\Exception $e) {

0 commit comments

Comments
 (0)