R
ragtek
Guest
ATM it's not possible to manipulate the fetch criteria, that's why i have to overwrite the COMPLETE method.
for example:
What about sending the fetchConditions & controller as reference to an event, so we can manipulate them? ( i know this would add too many new event listeners, but i'm not sure if there's any other way for this.. )
it's the same problem with the memberlist ( http://xenforo.com/community/threads/banned-users-still-in-members-list.11898/ ).
if i would want to change the criteria
i would need to copy the whole code and include it in my method.
what, if now a second add-on wants to manipulate here something too?
another similar problem are "save actions"
what if i need to save own fields for a existing dw?
ATM we have to do really ugly things.. (e.g. overwrite whole method, stop the redirect, grab the last id, fetch the data,..... see my thread in the dev. forum where i asked how to save own additional fields in the acp user edit form..)
for example:
PHP:
class Ragtek_SMT_ControllerPublic_Forum extends
XFCP_Ragtek_SMT_ControllerPublic_Forum
{ public function actionIndex()
{
// same code as in the parent actionIndex, only with this addition:
$showOnlyMyThreads = $this->checkCookie();
...
if ($showOnlyMyThreads){
$threadFetchConditions['user_id'] = $visitor['user_id'];
}
}
}
What about sending the fetchConditions & controller as reference to an event, so we can manipulate them? ( i know this would add too many new event listeners, but i'm not sure if there's any other way for this.. )
it's the same problem with the memberlist ( http://xenforo.com/community/threads/banned-users-still-in-members-list.11898/ ).
if i would want to change the criteria
PHP:
$criteria = array(
'user_state' => 'valid'
);
// users for the member list
$users = $userModel->getUsers($criteria, array(
'join' => XenForo_Model_User::FETCH_USER_FULL,
'perPage' => $usersPerPage,
'page' => $page
));
what, if now a second add-on wants to manipulate here something too?
another similar problem are "save actions"
what if i need to save own fields for a existing dw?
ATM we have to do really ugly things.. (e.g. overwrite whole method, stop the redirect, grab the last id, fetch the data,..... see my thread in the dev. forum where i asked how to save own additional fields in the acp user edit form..)
Upvote
1