According to the CakePHP manual, you can pass a $fieldList option to Model::saveAll to restrict saving to only certain fields. However, it completely neglects to give an example of the correct format of the parameter. What’s the appropriate format of a $fieldList in the context of saveAll(), specifically saveAssociated(), when you want to enumerate fields on multiple related models?
According to the CakePHP manual , you can pass a $fieldList option to Model::saveAll
Share
The documentation you linked to is actually for the
save()method. ThesaveAll()method only takes two parameters.The second parameter of
saveAll()is an array of options, of which one can befieldList. This is equivalent to thefieldListparameter of thesave()method.It states this parameter is an array of field names.