[RSS Feed/News] Proper way to use assertRecordExists

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
I'm trying to leverage the assertRecordExists functionality and i'm not getting consistent results.

the base code looks like:

Code:

Code:
$finder->where('x', $params['slug']); 
$x= $finder->fetchOne();

$x= $this->assertRecordExists('NS\Addon:X', $x['id'], null, null);

if(!$x)
{
       throw $this->exception($this->notFound('X Not Found in our Database'));
}

When i test a record that exists, it functions correctly.

When i test a record that doesn't exist, it throws an exception...

Read more

ادامه مطلب...
 
Status
Not open for further replies.
Back
Top Bottom