Hi
Stop me if you’ve heard this one.
So i wanted to restrict the accessible fields an entity in my app.
I looked at this example in the docs.
class Article extends Entity
{
protected $_accessible = [
‘title’ => true,
‘body’ => true
];
}
I found that even when i set all the fields to true i was getting an error.
Now there is a related model. There’s a booking with a related customer.
The error i get says, ‘Could not find record in bookings table’
If i do this:
class Booking extends Entity
{
protected $_accessible = [
‘id’ => false,
‘customer_id’ => false,
‘*’ => true,
];
}
It works fine.
So the question is: What is the difference between having ‘*’ => true and having a list of all your fields set to true?
Is it the related data?
Any advice on this would be very much appreciated folks.