Luc Lérot Freelance Posted August 24, 2012 Share Posted August 24, 2012 Hi guys, here's a skeleton of ProductAttribute Class. There no "association" for now (as I don't need it for my current work) but I thought it might help someone. Feel free to complete the calss if you want to. <?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 More sharing options...
Recommended Posts