Jump to content

Edit History

karcharoth

karcharoth

Your were extending ObjectModel class with a non-existing class (LoyaltyAPICore) - so the override could not be created. You should extend ObjectModel class, like this:

On 9/18/2014 at 12:07 PM, xbenjii said:

/modules/totLoyaltyAdvanced/override/classes/webservice/WebserviceRequest.php


class WebserviceRequest extends WebserviceRequestCore {
    public static function getResources(){
        $resources = parent::getResources();
        $resources['loyalty'] = array('description' => 'Loyalty management for products', 'class' => 'ObjectModel');
        ksort($resources);
        return $resources;
    }

}

/modules/totLoyaltyAdvanced/override/classes/ObjectModel.php


class ObjectModel extends ObjectModelCore {

    public $id_product;
    public $loyalty;
    public $date_begin;
    public $date_finish;

    public function __construct($id = null, $id_lang = null, $id_shop = null)
    {  
        self::$definition['table'] = 'totloyaltyadvanced';
        self::$definition['primary'] = 'id';
        self::$definition['fields']['id_product'] = array('type' => self::TYPE_INT, 'required' => true);
        self::$definition['fields']['loyalty'] = array('type' => self::TYPE_STRING, 'required' => true);
        self::$definition['fields']['date_begin'] = array('type' => self::TYPE_STRING);
        self::$definition['fields']['date_finish'] = array('type' => self::TYPE_STRING);
        parent::__construct($id, $id_lang, $id_shop);
    } 
    
}

It should work fine now. Tested on PS 1.6.1.20.

karcharoth

karcharoth

Your were extending ObjectModel class with a non-existing class (LoyaltyAPICore) - so the override could not be created. You should extend ObjectModel class, like this:

On 9/18/2014 at 12:07 PM, xbenjii said:

/modules/totLoyaltyAdvanced/override/classes/webservice/WebserviceRequest.php


class WebserviceRequest extends WebserviceRequestCore {
    public static function getResources(){
        $resources = parent::getResources();
        $resources['loyalty'] = array('description' => 'Loyalty management for products', 'class' => 'ObjectModel');
        ksort($resources);
        return $resources;
    }

}

/modules/totLoyaltyAdvanced/override/classes/ObjectModel.php


class ObjectModel extends ObjectModelCore {

    public $id_product;
    public $loyalty;
    public $date_begin;
    public $date_finish;

    public function __construct($id = null, $id_lang = null, $id_shop = null)
    {  
        self::$definition['table'] = 'totloyaltyadvanced';
        self::$definition['primary'] = 'id';
        self::$definition['fields']['id_product'] = array('type' => self::TYPE_INT, 'required' => true);
        self::$definition['fields']['loyalty'] = array('type' => self::TYPE_STRING, 'required' => true);
        self::$definition['fields']['date_begin'] = array('type' => self::TYPE_STRING);
        self::$definition['fields']['date_finish'] = array('type' => self::TYPE_STRING);
        parent::__construct($id, $id_lang, $id_shop);
    } 
    
}

It should work fine now.

karcharoth

karcharoth

Your were extending ObjectModel class with a non-existing class (LoyaltyAPICore). You should extend ObjectModel class, like this:

On 9/18/2014 at 12:07 PM, xbenjii said:

/modules/totLoyaltyAdvanced/override/classes/webservice/WebserviceRequest.php


class WebserviceRequest extends WebserviceRequestCore {
    public static function getResources(){
        $resources = parent::getResources();
        $resources['loyalty'] = array('description' => 'Loyalty management for products', 'class' => 'ObjectModel');
        ksort($resources);
        return $resources;
    }

}

/modules/totLoyaltyAdvanced/override/classes/ObjectModel.php


class ObjectModel extends ObjectModelCore {

    public $id_product;
    public $loyalty;
    public $date_begin;
    public $date_finish;

    public function __construct($id = null, $id_lang = null, $id_shop = null)
    {  
        self::$definition['table'] = 'totloyaltyadvanced';
        self::$definition['primary'] = 'id';
        self::$definition['fields']['id_product'] = array('type' => self::TYPE_INT, 'required' => true);
        self::$definition['fields']['loyalty'] = array('type' => self::TYPE_STRING, 'required' => true);
        self::$definition['fields']['date_begin'] = array('type' => self::TYPE_STRING);
        self::$definition['fields']['date_finish'] = array('type' => self::TYPE_STRING);
        parent::__construct($id, $id_lang, $id_shop);
    } 
    
}

It should work fine now.

karcharoth

karcharoth

Your were extending a non-existing class. You should extend ObjectModel class, like this:

On 9/18/2014 at 12:07 PM, xbenjii said:

/modules/totLoyaltyAdvanced/override/classes/webservice/WebserviceRequest.php


class WebserviceRequest extends WebserviceRequestCore {
    public static function getResources(){
        $resources = parent::getResources();
        $resources['loyalty'] = array('description' => 'Loyalty management for products', 'class' => 'ObjectModel');
        ksort($resources);
        return $resources;
    }

}

/modules/totLoyaltyAdvanced/override/classes/ObjectModel.php


class ObjectModel extends ObjectModelCore {

    public $id_product;
    public $loyalty;
    public $date_begin;
    public $date_finish;

    public function __construct($id = null, $id_lang = null, $id_shop = null)
    {  
        self::$definition['table'] = 'totloyaltyadvanced';
        self::$definition['primary'] = 'id';
        self::$definition['fields']['id_product'] = array('type' => self::TYPE_INT, 'required' => true);
        self::$definition['fields']['loyalty'] = array('type' => self::TYPE_STRING, 'required' => true);
        self::$definition['fields']['date_begin'] = array('type' => self::TYPE_STRING);
        self::$definition['fields']['date_finish'] = array('type' => self::TYPE_STRING);
        parent::__construct($id, $id_lang, $id_shop);
    } 
    
}

It should work fine now.

karcharoth

karcharoth

Your were extending a non-existing class. You should extend ObjectModel class, like this:

On 9/18/2014 at 12:07 PM, xbenjii said:

/modules/totLoyaltyAdvanced/override/classes/webservice/WebserviceRequest.php


class WebserviceRequest extends WebserviceRequestCore {
    public static function getResources(){
        $resources = parent::getResources();
        $resources['loyalty'] = array('description' => 'Loyalty management for products', 'class' => 'ObjectModel');
        ksort($resources);
        return $resources;
    }

}

/modules/totLoyaltyAdvanced/override/classes/ObjectModel.php


class ObjectModel extends ObjectModelCore {

    public $id_product;
    public $loyalty;
    public $date_begin;
    public $date_finish;

    public function __construct($id = null, $id_lang = null, $id_shop = null)
    {  
        self::$definition['table'] = 'totloyaltyadvanced';
        self::$definition['primary'] = 'id';
        self::$definition['fields']['id_product'] = array('type' => self::TYPE_INT, 'required' => true);
        self::$definition['fields']['loyalty'] = array('type' => self::TYPE_STRING, 'required' => true);
        self::$definition['fields']['date_begin'] = array('type' => self::TYPE_STRING);
        self::$definition['fields']['date_finish'] = array('type' => self::TYPE_STRING);
        parent::__construct($id, $id_lang, $id_shop);
    } 
    
}

 

×
×
  • Create New...