I have a Product model with the following rules:
...
array('normal_price, company_id, purchase_price', 'safe', 'on' => 'adminList'),
array('normal_price, company_id', 'safe', 'on' => 'list'),
...
And I call the following function:
$product->scenario = 'list';
$product->safeAttributeNames;
The code above should only return ['normal_price, company_id']
, but I get the purchase_price
as well, all time. Even if I delete the first rule for the adminList
scenario.
I would need the list of attributes, that I specify. What could be the problem with my code?