We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • This:
    $modx->getService('myclass','MyClass', MODX_CORE_PATH . 'components/nhs/model/nhs/myclass.class.php');

    should be
    $modx->getService('myclass','MyClass', MODX_CORE_PATH . 'components/nhs/model/nhs/');


    The third param is the path to the directory the class is in, not the path to the actual file.
      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
      • 40541
      • 85 Posts
      Are, I see - I should perhaps should have perhaps noticed that for myself (I picked that up from your orginal post smiley

      Also noticed in myclass that

      this->modx->log(modX::LOG_LEVEL_ERROR, ($modx->myDB->connect()) ? 'Connected </br>' : 'Not Connected' );


      needs to be

      this->modx->log(modX::LOG_LEVEL_ERROR, ($this->myDB->connect()) ? 'Connected </br>' : 'Not Connected' );


      The DB now connects and the package loads but I get no results on the call:

      $results = $modx->myclass->myDB->getCollection('LogData',array('diallednumber' => $search));


      Its the same getCollection call and $search (of 4182) I use when not using the myclass so I know the syntax is correct. I'll play around with it a bit more unless you know the quick answer that is smiley

      Appreciate your assistance anyway.