Snog
Well-known member
I know it's a task, but adding a CalledBy variable to all model functions would allow developers to decide if their extension to model functions should run during certain operations or not.
For example, let's say a node gets extended using a developer's table and there's no need to have that info during a rebuild, the developer could condition his extension with something like if(!$calledBy == 'deferred') and prevent it from running during a deferred process.
ie:...
Would be called like this..
We already have the Hint in the listener, but this would extend that concept even farther at the model level. I can think of many instances where this would come in handy.
For example, let's say a node gets extended using a developer's table and there's no need to have that info during a rebuild, the developer could condition his extension with something like if(!$calledBy == 'deferred') and prevent it from running during a deferred process.
ie:...
Code:
public function getThreadById($threadId, array $fetchOptions = array(), $calledBy = null)
Would be called like this..
Code:
$thread = $this->getModelFromCache('XenForo_Model_Thread')->getThreadById(
$routeUrlMatch['params']['thread_id'],
array('join' => XenForo_Model_Thread::FETCH_FORUM),
'inlinemod'
);
We already have the Hint in the listener, but this would extend that concept even farther at the model level. I can think of many instances where this would come in handy.
Last edited:
Upvote
0