View Single Post
  #3  
Old 09-22-2019, 06:10 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Adding a property to the model "Order"

Quote:
Originally Posted by tony_sologubov

The process of adding a new property to the model is described here:
https://devs.x-cart.com/basics/adding_new_property_to_a_product/#decorating-model-class

This example is for \XLite\Model\Product class, but you can decorate \XLite\Model\Order class all the same. Although, you will be adding orderColor property instead of myMessage.



I have tried this, with model class Vendor/ModuleID/Model/Order.php
Code:
<?php namespace XLite\Module\Vendor\ModuleID\Model; abstract class Order extends \XLite\Model\Order { /** * @Column (type="string") */ protected $quotestatus = ''; public function getQuotestatus() { return $this->quotestatus; } public function setQuotestatus($value) { $this->quotestatus = $value; return $this; } }
with the error
Code:
X-Cart rebuild step failed Step failed with the following errors:
  • Class "XLite\Module\Vendor\Module\Model\Order" sub class of "XLite\Model\Order" is not a valid entity or mapped super class
What am I doing wrong here? I also tried without "abstract" with the same result.
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote