Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
fixed tests
  • Loading branch information
simialbi committed Apr 25, 2019
1 parent 308974a commit 4633c0c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ To use this extension, configure restclient component in your application config
// },
// 'auth' => 'Bearer: <mytoken>',
// 'usePluralisation' => false,
// 'enableExceptions' => true,
],
],
```
Expand All @@ -50,7 +51,8 @@ To use this extension, configure restclient component in your application config
| ------------------ | ---------------------------------------------------------------------------------------------------------------- |
| `baseUrl` | The location of the api. E.g. for http://api.site.com/v1/users the `baseUrl` would be http://api.site.com/v1/ |
| `auth` | Either a Closure which returns a `string` or a `string`. The rest connection will be passed as parameter. |
| `usePluralisation` | Whether to use plural version for lists (index action) or not (e.g. http://api.site.com/users instead of `user`) |
| `usePluralisation` | Whether to use plural version for lists (index action) or not (e.g. http://api.site.com/users instead of `user`) |
| `enableExceptions` | Whether the connection should throw an exception if response is not 200 or not |

## Usage
Define your Model
Expand Down
22 changes: 21 additions & 1 deletion src/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

/**
* Class Query
*
* @property string $modelClass the name of the ActiveRecord class.
*/
class Query extends \yii\db\Query implements QueryInterface
{
Expand All @@ -24,7 +26,7 @@ class Query extends \yii\db\Query implements QueryInterface
/**
* @var mixed Value of the primary key (special where)
*/
public $modelClass;
private $_modelClass;

/**
* Constructor.
Expand Down Expand Up @@ -154,4 +156,22 @@ public static function create($from)
'params' => $from->params,
]);
}

/**
* Getter for modelClass
* @return mixed
*/
public function getModelClass()
{
return $this->_modelClass;
}

/**
* Setter for modelClass
* @param mixed $modelClass
*/
public function setModelClass($modelClass)
{
$this->_modelClass = $modelClass;
}
}

0 comments on commit 4633c0c

Please sign in to comment.