Skip to content

Commit 6379c89

Browse files
committed
Public release
0 parents  commit 6379c89

28 files changed

+2827
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior, including custom code if needed.
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Environment (please complete the following information):**
20+
- OS: [e.g. macOS]
21+
- Database: [e.g. mysql, mariadb]
22+
- xPDO and/or MODX Version: [e.g. xPDO 2.7.0-pl, MODX 2.7.2]
23+
24+
**Additional context**
25+
Add any other context about the problem here.
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.gitignore

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
### Composer ###
2+
composer.phar
3+
vendor/
4+
5+
### PHPUnit ###
6+
phpunit.xml
7+
8+
### Config files ###
9+
tests/properties.inc.php
10+
11+
### OSX ###
12+
# General
13+
.DS_Store
14+
.AppleDouble
15+
.LSOverride
16+
17+
# Icon must end with two \r
18+
Icon
19+
20+
# Thumbnails
21+
._*
22+
23+
# Files that might appear in the root of a volume
24+
.DocumentRevisions-V100
25+
.fseventsd
26+
.Spotlight-V100
27+
.TemporaryItems
28+
.Trashes
29+
.VolumeIcon.icns
30+
.com.apple.timemachine.donotpresent
31+
32+
# Directories potentially created on remote AFP share
33+
.AppleDB
34+
.AppleDesktop
35+
Network Trash Folder
36+
Temporary Items
37+
.apdisk
38+
39+
### PhpStorm ###
40+
.idea
41+
42+
# IntelliJ
43+
out/
44+
45+
# Editor-based Rest Client
46+
.idea/httpRequests
47+
48+
### Windows ###
49+
# Windows thumbnail cache files
50+
Thumbs.db
51+
Thumbs.db:encryptable
52+
ehthumbs.db
53+
ehthumbs_vista.db
54+
55+
# Dump file
56+
*.stackdump
57+
58+
# Folder config file
59+
[Dd]esktop.ini
60+
61+
# Recycle Bin used on file shares
62+
$RECYCLE.BIN/
63+
64+
# Windows Installer files
65+
*.cab
66+
*.msi
67+
*.msix
68+
*.msm
69+
*.msp
70+
71+
# Windows shortcuts
72+
*.lnk

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020-present Springbok Agency BV (https://www.springbokagency.com)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Faker xPDO ORM Adapter
2+
3+
A [Faker](https://github.com/fzaninotto/Faker) ORM adapter to populate [xPDO](http://xpdo.org) objects with fake data.
4+
5+
# Table of contents
6+
7+
- [Installation](#installation)
8+
- [Usage](#usage)
9+
10+
## Installation
11+
12+
Install as development dependency using [Composer](https://getcomposer.org).
13+
14+
``` bash
15+
$ composer require --dev springbokagency/faker-xpdo-orm-adapter
16+
```
17+
18+
## Usage
19+
To populate xPDO objects, create a new populator class (using a generator instance as parameter), then list the class and number of all the objects that must be generated. To launch the actual data population, call the execute() method.
20+
21+
Here is an example showing how to populate 5 `modUser` and 10 `modResource` objects:
22+
23+
```php
24+
<?php
25+
$generator = \Faker\Factory::create();
26+
$populator = new \SpringbokAgency\Faker\ORM\xPDO\Populator($generator);
27+
$populator->addEntity(\modUser::class, 5);
28+
$populator->addEntity(\modResource::class, 10);
29+
$insertedPKs = $populator->execute();
30+
```
31+
32+
For more info read [the Faker documentation](https://github.com/fzaninotto/Faker#populating-entities-using-an-orm-or-an-odm).

composer.json

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "springbokagency/faker-xpdo-orm-adapter",
3+
"type": "library",
4+
"description": "xPDO ORM adapter for faker",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Joshua Lückers",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"repositories": [
13+
{
14+
"type": "package",
15+
"package": {
16+
"name": "modxcms/xpdo2",
17+
"version": "v2.8.0-pl",
18+
"source": {
19+
"url": "[email protected]:modxcms/xpdo.git",
20+
"type": "git",
21+
"reference": "origin/2.x"
22+
}
23+
}
24+
}
25+
],
26+
"require": {
27+
"fzaninotto/faker": "^1.9.1"
28+
},
29+
"require-dev": {
30+
"modxcms/xpdo2": "^2.8",
31+
"phpunit/phpunit": "~6.5"
32+
},
33+
"autoload": {
34+
"psr-4": {
35+
"SpringbokAgency\\": "src/"
36+
}
37+
},
38+
"autoload-dev": {
39+
"psr-4": {
40+
"SpringbokAgency\\Tests\\": "tests/"
41+
},
42+
"classmap": [
43+
"vendor/modxcms/xpdo2/xpdo/",
44+
"tests/test_package/core/components/faker-xpdo-orm-adapter/model/faker-xpdo-orm-adapter/"
45+
]
46+
}
47+
}

0 commit comments

Comments
 (0)