Skip to content

Commit

Permalink
improved README
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Oct 26, 2015
1 parent b097fdf commit 7218232
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .hidev/commits.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ hiqdev/yii2-hiart commits history

## 0.0.2 Under development

- b097fdf 2015-10-26 x QueryBuilder::buildLimit() - added conversion of `-1` limit to `ALL` (d.naumenko.a@gmail.com)
- 9d72ad6 2015-10-26 - Removed ActiveRecord::arrayAttributes method (d.naumenko.a@gmail.com)
- Added recursive joining
- 7bf29fe 2015-10-23 + ActiveQuery added recusion population of joined relation (d.naumenko.a@gmail.com)
- Changed default limit to ALL
Expand Down
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Tools to use API as ActiveRecord for Yii2
-----------------------------------------
=========================================

Use your API as ActiveRecord

Expand All @@ -25,9 +25,42 @@ or add

to the require section of your composer.json.

## Configuration

To use this extension, configure hiart component in your application config:

```php
'components' => [
'hiart' => [
'class' => 'hiqdev\hiart\Connection',
'config' => [
'api_url' => 'https://api.site.com/',
],
],
],
```

## Usage

Define your Model

```php
class MyModel extends \hiqdev\hiart\ActiveRecord
{
public function attributes()
{
return ['id', 'name', 'else'];
}
}
```

## License

This project is released under the terms of the BSD-3-Clause [license](https://github.com/hiqdev/yii2-hiart/blob/master/LICENSE).
Read more [here](http://choosealicense.com/licenses/bsd-3-clause).

Copyright © 2015, HiQDev (http://hiqdev.com/)

## Acknowledgments

- This project is based on [Yii2 Elasticsearch](https://github.com/yiisoft/yii2-elasticsearch).
2 changes: 2 additions & 0 deletions docs/readme/Acknowledgments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- This project is based on [Yii2 Elasticsearch](https://github.com/yiisoft/yii2-elasticsearch).

12 changes: 12 additions & 0 deletions docs/readme/Configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
To use this extension, configure hiart component in your application config:

```php
'components' => [
'hiart' => [
'class' => 'hiqdev\hiart\Connection',
'config' => [
'api_url' => 'https://api.site.com/',
],
],
],
```
12 changes: 12 additions & 0 deletions docs/readme/Usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Define your Model

```php
class MyModel extends \hiqdev\hiart\ActiveRecord
{
public function attributes()
{
return ['id', 'name', 'else'];
}
}
```

15 changes: 15 additions & 0 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@
use yii\helpers\ArrayHelper;
use yii\helpers\Json;

/**
* Connection class.
*
* Example configuration:
* ```php
* 'components' => [
* 'hiart' => [
* 'class' => 'hiqdev\hiart\Connection',
* 'config' => [
* 'api_url' => 'https://api.site.com/',
* ],
* ],
* ],
* ```
*/
class Connection extends Component
{
const EVENT_AFTER_OPEN = 'afterOpen';
Expand Down

0 comments on commit 7218232

Please sign in to comment.