R
ragtek
Guest
What should we do, if several different Add-ons needs the same method?
For example:
the widget framework includes/extends the thread model with
That's a very usefull method, which i'm using in my add-on too.
In my board i know it's available, so i don't need to extend the model a second time, but what should i do in my released add-on?
It's IMHO extrem ugly, to include this a second time
All users which have installed the widgetframework and my global feed add-on have now two add-ons extending the thread model with the same method.
Do we really need to extend it 2 times, or is there a better way?
(sorry for the bad english, i hope you know what i mean^^)
For example:
the widget framework includes/extends the thread model with
PHP:
public function prepareThreadConditions(array $conditions, array &$fetchOptions) {
$preCondition = parent::prepareThreadConditions($conditions, $fetchOptions);
if (!empty($conditions['forum_ids'])) {
$sqlCond = array($preCondition);
if (!empty($conditions['forum_ids'])) {
$sqlCond[] = 'thread.node_id IN (' . $this->_getDb()->quote($conditions['forum_ids']) . ')';
}
return $this->getConditionsForClause($sqlCond);
} else {
return $preCondition;
}
That's a very usefull method, which i'm using in my add-on too.
In my board i know it's available, so i don't need to extend the model a second time, but what should i do in my released add-on?
It's IMHO extrem ugly, to include this a second time

All users which have installed the widgetframework and my global feed add-on have now two add-ons extending the thread model with the same method.
Do we really need to extend it 2 times, or is there a better way?
(sorry for the bad english, i hope you know what i mean^^)