Jump to content

Override new class


jose@myeasygest

Recommended Posts

Hello:

I have a problem with a new class of its own that the prestashop system does not copy in its override directory from the system root, this file is located in the override / classes / Myclass.php directory of my module.

I use this new class to access by webservice and I have another WebserviceRequest.php file in override / classes / webservice / WebserviceRequest.php and this file if I copy it well.

 

At this point the new class appears as an option in the webservice configuration list to give permissions on it, but when you try to access the webservice it gives an error because it can not find the class.

 

If I manually copy the override / classes / Myclass.php file into the root override this works fine.

 

My question is how to run the override from the modules with new classes?

 

MyClass.php:

 


class MyClass extends ObjectModel

{

    public $id_My_Class;

    public $action;

    public $status;

 

    public function __construct($full = false, $id_lang = null, $id_shop = null, Context $context = null)

    {

        $this->webserviceParameters['My_Class'] = array('fields' => array('action' => array('required' => true),'status' => array('required' => false) ));

        parent::__construct($full, $id_lang, $id_shop, $context);

    }

    protected $webserviceParameters = array();

    public static $definition = array(

        'table' => 'My_Class',

        'primary' => 'id_My_Class',

        'fields' => array(

            'action' => array('type' => self::TYPE_STRING, 'required' =>true),

            'status' => array('type' => self::TYPE_STRING, 'required' =>false)

        )

    );

}

 


 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...