Yii Framework Forum: Using fields() with asArray() - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Using fields() with asArray()

#1 User is offline   _marcelo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 68
  • Joined: 22-October 15

Posted 31 January 2018 - 07:36 AM

In a endpoint, i will show the resource with all relations and without use expand parameter.

When i use the followin ActiveQuery, the fields() are respected but i need use expand parameter to show relations


Model::Find()->all();


if use asArray(), the fields() is ignored and show all data including relations (wich i want)

Model::Find()->asArray()->all();


Is there something else to do?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users