Skip to content

Commit

Permalink
Update to use $queryAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhall17 committed Aug 2, 2019
1 parent 32b3495 commit e6d6d7b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `laravel-xero` will be documented in this file

## 1.0.10 - 2019-08-02

Update to use $queryAttributes

## 1.0.9 - 2019-07-26

Update guzzle responses to use getbody in stead of getContents. Also added Contracts and Facades to tie in with Laravel.
Expand Down
5 changes: 5 additions & 0 deletions src/AccountingContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ class AccountingContact extends Model
'Phones' => '\MacsiDigital\Xero\AccountingPhone',
'ContactPersons' => '\MacsiDigital\Xero\AccountingContactPerson',
];

protected $queryAttributes = [
'Name',
'EmailAddress'
];

public function addAddress($item)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Support/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
abstract class Model
{
protected $attributes = [];
protected $query_attributes = [];
protected $queryAttributes = [];
protected $relationships = [];
protected $queries = [];
protected $methods = [];
Expand Down Expand Up @@ -302,7 +302,7 @@ public function save()

public function where($key, $operator, $value = '')
{
if (in_array($key, $this->query_attributes)) {
if (in_array($key, $this->queryAttributes)) {
if ($value == '') {
$value = $operator;
$operator = '=';
Expand Down

0 comments on commit e6d6d7b

Please sign in to comment.