在布尔值 shipcron.php 上调用成员函数 getStores()

Call to a member function getStores() on boolean shipcron.php

当我从 magento 根文件 getstoredata.php 调用模型函数时,出现错误 调用布尔值 getstoredata.php 上的成员函数 getStores()。 请检查以下文件并帮助找出我的错误。

getstoredata.php.

<?php
define('MAGENTOROOT', realpath(dirname(__FILE__)));
require_once(MAGENTOROOT.'/app/Mage.php');
Mage::app()->cleanCache();
flush();




Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

 $model= Mage::getModel('fulfillment/processorders');
 $data = $model->getStores();

 print_r($data);

config.xml

<?xml version="1.0" encoding="utf-8" ?>
<config>
  <modules>
    <Test_Fulfillment>
      <version>0.1.2</version>
    </Test_Fulfillment>
  </modules>

  <global>
    <models>
      <fulfillment>
        <class>Test_Fulfillment_Model</class>
        <resourceModel>fulfillment_mysql4</resourceModel>
      </fulfillment>
      <fulfillment_mysql4>
          <class>Test_Fulfillment_Model_Mysql4</class>
          <entities>
              <clearpathparcel>
                  <table>test_fulfillment_clearpathparcel</table>
              </clearpathparcel>
          </entities>
      </fulfillment_mysql4>
     </models>
</global>
</config>

Processorders.php

class Test_Fulfillment_Model_ProcessOrders extends Test_Fulfillment_Model_Abstract {
    protected $_orderStatusXml = null;

    protected  function getStores() {
        $stores = array();



        $stores[] = Mage::getModel('core/store')->load('dunkin_recognition')->getId();
        $stores[] = Mage::getModel('core/store')->load('baskinrobbins')->getId();
        $stores[] = Mage::getModel('core/store')->load('spotify')->getId();
        $stores[] = Mage::getModel('core/store')->load('duffandphelps_inv')->getId();
        $stores[] = Mage::getModel('core/store')->load('amex')->getId();
        $stores[] = Mage::getModel('core/store')->load('ab')->getId();
        $stores[] = Mage::getModel('core/store')->load('jackson_hewitt')->getId();
        return $stores;

    }

请将受保护更改为 public。您将函数声明为受保护的,您不能在 class.

之外调用受保护的函数