Support is online

Csvirules plugin and $fields array #7244

Open gnsbud opened this topic Friday, 20 March 2015 · 2 replies
Author

Hi,

I'm trying to write small csvirules plugin. In "replace" plugin I can see comment:

* @param   array   $fields    All fields used for import/export

how can I access keys and values in $fields array? No matter what I try, returning message is the same:

Cannot use object of type CsviHelperFields as array

Best regards,
Chris

Author

Hi,

nevermind, did something like:

$fields->getData()

then I was able to access $fields as an array.

Best regards,
Chris

Support

Hello Chris,

Ah, the $fields docblock is incorrect. It is indeed no longer an array but a class. You can also use:

$fields->getFields();

to just get the fields. Thanks for posting your findings.

Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Log in to reply to this topic.