I need a another place for my custom_fields;
I replace XF/Entity/Threadfield with
May someone show me, please, how to do this in a dynamic way like:
fetch the value from 'groups' => ['before', 'after', 'thread_status'],
add 'thread_header' and extend that array to be used by XF.
I have to do the same with XF/Repository/ThreadField
should i extend both classes or do this in a listener?
I replace XF/Entity/Threadfield with
PHP:
<?php
namespace Robert9\ThreadFieldsHeader\XF\Entity;
use XF\Mvc\Entity\Structure;
class ThreadField extends XFCP_ThreadField
{
public static function getStructure(Structure $structure)
{
self::setupDefaultStructure(
$structure,
'xf_thread_field',
'XF:ThreadField',
[
//'groups' => ['before', 'after', 'thread_status'],
'groups' => ['before', 'after', 'thread_status', 'thread_header'],
'has_user_group_editable' => true,
'has_wrapper_template' => true,
]
);
$structure->relations['ForumFields'] = [
'entity' => 'XF:ForumField',
'type' => self::TO_MANY,
'conditions' => 'field_id'
];
return $structure;
}
}
May someone show me, please, how to do this in a dynamic way like:
fetch the value from 'groups' => ['before', 'after', 'thread_status'],
add 'thread_header' and extend that array to be used by XF.
I have to do the same with XF/Repository/ThreadField
should i extend both classes or do this in a listener?