Fork me on GitHub

Grabbing tables from other modules  Bottom

Go to page [-1] 1 - 2:

  • Ah, the EZComments one makes it all clear. This is going to clean up a couple of my mods. Yay!
  • OK...cool.

    One more thing...let's say I wanted to run a query on a table that wasn't defined in my module. It would make more sense to add a function to the correct module (SKConfig) and then call that function from the other module (FoodManagement), rather than create the function in FoodManagement and use pnModDBInfoLoad(), right?
  • Just a quick note. You may also want to check the "getall" function from SKConfig to see if it has any parameters that are needed. Calling another module's API function will fail if all the required parameters are not specified.

    so maybe .... pnModAPIFunc('SKConfig', 'user', 'getall');
    may need to be .... pnModAPIFunc('SKConfig', 'user', 'getall', array('param1' => data1, 'param2 => data2, ...));

    --
    cyber_wolf
    www.bkbsolutions.com - My Zikula module development site.
  • Thanks...it works now...the problem was in my call to pnModAPIFunc()...it didn't work earlier and I am still not sure why.
    My only outstanding question is:

    let's say I wanted to run a query on a table that wasn't defined in my module. It would make more sense to add a function to the correct module (SKConfig) and then call that function from the other module (FoodManagement), rather than create the function in FoodManagement and use pnModDBInfoLoad(), right?

    Does that question make sense? Thanks for all of your help everyone.
  • The problem with modding another modle would be that, if that module updates and they add a function called the same thing, but that does something differently, it would mess things up. It's something you wouldn't have any control over.
  • Well, the thing is, I would be the only person editing/updating that other module, so it really wouldn't be an issue.
  • Then I guess it just depends on if you want to check the code every time you want to update the other module. If it's your own module, no big deal, but if it's a module someone else is developing, you'd have to check it every time you updated it. Sounds like something that would get to be a real pain, which is why I'd recommend just doing the function in your own module. But if you don't think it'll be a problem, I wouldn't worry about it. :)

Go to page [-1] 1 - 2:

  • 0 users

This list is based on users active over the last 60 minutes.