Skip to content

Commit 7a769f5

Browse files
committed
resolveFields method update
1 parent 7c566ae commit 7a769f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ResourceTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function getAttributes(array $fields = [])
4444
{
4545
$attributes = [];
4646

47-
foreach (self::resolveFields($this->fields(), $fields) as $name => $definition) {
47+
foreach ($this->resolveFields($this->fields(), $fields) as $name => $definition) {
4848
$attributes[$name] = is_string($definition) ? $this->$definition : call_user_func($definition, $this, $name);
4949
}
5050
return $attributes;
@@ -57,7 +57,7 @@ public function getRelationships()
5757
{
5858
$relationships = [];
5959

60-
foreach (self::resolveFields($this->extraFields()) as $name => $definition) {
60+
foreach ($this->resolveFields($this->extraFields()) as $name => $definition) {
6161
if (is_string($definition)) {
6262
$relation = $this->$definition;
6363
if (!is_array($relation)) {
@@ -122,7 +122,7 @@ public function extraFields()
122122
* @param array $fieldSet
123123
* @return array
124124
*/
125-
protected static function resolveFields(array $fields, array $fieldSet = [])
125+
protected function resolveFields(array $fields, array $fieldSet = [])
126126
{
127127
$result = [];
128128

0 commit comments

Comments
 (0)