title: Fatal error:  Access to undeclared static property
body: <p>I'm trying to use some extended <code>Zend_Db_Table</code> class from PHP CLI (Command Line Interface).</p>
  
  <p>Everything is working as expected, when used via Apache. But when used from CLI I get the following error:</p>
  
  <blockquote>
    <p>[01-Feb-2011 14:41:34] PHP Fatal error:  Access to undeclared static property: <code>KidsclubIdentities::$tableName</code> in /home/www/</p>
  </blockquote>
  
  <p>If I <code>var_dump($tableVariables); die();</code> in the <code>col()</code> function of the class below I get a printout as expected, but <strong>NOT INCLUDING</strong> the <code>public static</code> variables of my model (<code>KidsclubIdentities</code>).</p>
  
  <p>So my best guess is that the scope is different, when using CLI vs. Apache</p>
  
  <pre><code>class My_Db_Table extends Zend_Db_Table
  {
      public function col($varname) {
          $tableVariables = get_class_vars(get_class($this));
          if(array_key_exists($varname, $tableVariables)) {
              return $tableVariables[$varname];
          } else if(array_key_exists($varname . 'Column', $tableVariables)) {
              return $tableVariables[$varname . 'Column'];
          }
          return $varname;
      }
  
  [...]
  </code></pre>
  
  <p>My model</p>
  
  <pre><code>class KidsclubIdentities extends My_Db_Table
  {
      protected $_name = 'kidsclub_identities';
      protected $_rowClass = 'KidsclubIdentity';
  
      public static $tableName = 'kidsclub_identities';
      public static $primaryColumn = 'kidsclub_identity_id';
      public static $statusColumn = 'kidsclub_identity_status';
      public static $userIdColumn = 'user_id';
      public static $identityIdColumn = 'identity_id';
      public static $identityLocationTypeColumn = 'identity_location_type';
  </code></pre>
  
  <p>I was planning to use CLI to execute some operations from crontab. But I will move my focus onto apache based cron-script.</p>