title: static method/function make call to non static function inside same class
body: <p>I don't yet understand static and non static methods/functions (I will rather say method/function because i'm not so clear on the difference yet).</p>
  
  <p>I'm building an extension (module) for my <a href="http://www.boxbilling.com/" rel="nofollow">boxbilling</a> (BB) system and i'm kinda stuck.</p>
  
  <p>This class can hook into BB's events and allow me to perform additional actions.</p>
  
  <pre><code>class Blah_Blah
  {
  
     //The method/function that receives the event:    
      public static function onBeforeAdminCronRun(Box_Event $event)
      {
          startRun($event); //call "main" method/function to perform all my actions.
      }
  </code></pre>
  
  <p>I'm copying the coding style from another class that BB uses. So I ended up creating a main function with a couple of nested functions inside it.</p>
  
  <pre><code>public function startRun($event) // I believe that "public" exposes this method/function to the calling script, correct? if so, I can make private or remove "public"??
  {
    // some parameter assignments and database calls goes here.
    // I will be calling the below methods/functions from here passing params where required.
    $someArray = array(); // I want this array to be accessible in the methods/functions below
  
    function firstFunction($params)
    {
      ...some code here...
      return;
    }
    function secondFunction()
    {
      ...some code here...
      loggingFunction('put this in log file');
      return;
    }
    function loggingFunction($msg)
    {
      // code to write $msg to a file
      // does not return a value
    }
  }
  </code></pre>
  
  <p>What is the correct way to call <pre>startRun($event)</pre> inside <pre>public static function onBeforeAdminCronRun(Box_Event $event)</pre>?</p>
  
  <p>What is the correct way to call the nested methods/functions inside <pre>startRun($event)</pre>?</p>
  
  <p>Thank you.</p>