Jump to content

Recommended Posts

Yop,

 

Ci-dessous un début de classe ProductAttribute version 1.5 (sans associations pour le moment puisque je n'en ai pas besoin dans le cas présent).

 

Si quelqu'un veut la compléter, avec plaisir.

 

<?php
class ProductAttribute extends ObjectModel {

/** @var  */
public $id_product_attribute;
/** @var  */
public $id_product;
/** @var  */
public $reference;

/** @var  */
public $supplier_reference;

/** @var  */
public $location;

/** @var  */
public $ean13;

/** @var  */
public $upc;

/** @var  */
public $wholesale_price;

/** @var  */
public $price;

/** @var  */
public $ecotax;

/** @var  */
public $quantity;

/** @var  */
public $weight;

/** @var  */
public $unit_price_impact;

/** @var  */
public $default_on;

/** @var  */
public $minimal_quantity;

/** @var  */
public $available_date;




/**
 * @see ObjectModel::$definition
 */
public static $definition = array(
 'table' => 'product_attribute',
 'primary' => 'id_product_attribute',
 'multilang' => false,
 'fields' => array(  
  'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
  'reference' => array('type' => self::TYPE_INT, 'validate' => 'isReference', 'required' => true),
  'supplier_reference' => array('type' => self::TYPE_INT, 'validate' => 'isReference', 'required' => false),
  'location' => array('type' => self::TYPE_INT, 'validate' => 'isReference', 'required' => false),  
  'ean13' => array('type' => self::TYPE_INT, 'validate' => 'isEan13', 'required' => true),
  'upc' => array('type' => self::TYPE_INT, 'validate' => 'isUpc', 'required' => true),  
  'wholesale_price' => array('type' => self::TYPE_INT, 'validate' => 'isPrice', 'required' => true),  
  'price' => array('type' => self::TYPE_INT, 'validate' => 'isPrice', 'required' => true),  
  'ecotax' => array('type' => self::TYPE_INT, 'validate' => 'isPrice', 'required' => true),
  'quantity' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true),
  'weight' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedFloat', 'required' => true),

  'unit_price_impact' => array('type' => self::TYPE_INT, 'validate' => 'isPrice', 'required' => true),
  'default_on' => array('type' => self::TYPE_INT, 'validate' => 'isBool', 'required' => true),
  'minimal_quantity' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true),
  'available_date' => array('type' => self::TYPE_INT, 'validate' => 'isDateFormat', 'required' => true),
 ),
);


}

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...