XF 2.2 How to save custom fields in a job?

Robert9

Well-known member
How to save custom fields in a job?

In my job I have a resource and a thread,
i also have custom_fields from resource and thread

But I have no idea how to save this.



Code:
$threadEditor = $this->service('XF:Thread\Editor', $thread);
$threadEditor->setCustomFields($threadFields);
$threadEditor->save();

does not work,
Code:
Call to undefined method ...\Job\Import::service() in src/addons/.../Job/Import.php

Why many classes can use $this->service('XF:Thread\Editor', $thread);
What I have to do with my class to use it?


If I try

Code:
$thread->setCustomFields($threadFields);
$thread->save();

Other add-ons start crying like this one:

Code:
Call to undefined method SV\SearchImprovements\XF\Entity\ThreadCollab::setCustomFields()
 
Last edited:
Back
Top Bottom