title: Adding new table in rest api of prestashop webservice
body: <p>I've been successful in creating an extra table in the <strong>prestashop</strong> products table throught <strong>rest api of webservice</strong> , however the api link <strong><a href="http://127.0.0.1/prestashop/api/wb3d/1" rel="nofollow noreferrer">http://127.0.0.1/prestashop/api/wb3d/1</a></strong> wb3d is the new table which I have created in webservice . Which holds a path to an images directory somewhere on the web . This link when opened shows the data which has been saved in the database as seen in the following image below </p>
  
  <p><img src="https://i.stack.imgur.com/EZXud.png" alt="enter image description here">
  <strong>model</strong> is directory name on the web, so this <strong>api(wb3d)</strong> has been associated with the     <strong>product table</strong> in the webservice the <strong>link:<a href="http://127.0.0.1/prestashop/api/products/1" rel="nofollow noreferrer">http://127.0.0.1/prestashop/api/products/1</a></strong> when I open this link . The entry of the association is shown but the data is not shown **refer the below image **
           <img src="https://i.stack.imgur.com/lDxo5.png" alt="enter image description here"></p>
  
  <p>The highlighted area shows the wb3d table associated with the product table throught rest api of webservice . I'm unable to associate the wb3d tale data with product table data. So I can use it in other devices through webservice</p>
  
  <p>This is what I have tried so far</p>
  
  <pre><code>    &lt;?php
  class ProductMergeCore extends ObjectModel
  
  {  
      public $product_id;
      public $id_wb3d;
      public $directory_name;
      public static $definition = array(
      'table' =&gt; 'wb3d',
      'primary' =&gt; 'id_wb3d',
      'fields' =&gt; array(
      'id_wb3d' =&gt; array('type' =&gt; self::TYPE_INT,  'required' =&gt; true),
      'product_id' =&gt; array('type' =&gt; self::TYPE_INT, 'required' =&gt; true),
      'directory_name' =&gt; array('type' =&gt; self::TYPE_STRING,  'required' =&gt;false, 'size' =&gt; 64),
       ),
       );
      protected $webserviceParameters = array();
      }
      ?&gt;
  </code></pre>
  
  <p><strong>productmerge.php</strong> is responsible for creating an associate table entry in product table.</p>
  
  <pre><code> &lt;?php 
  
    Class Product extends ProductCore
  
    {
  
     public $extrafield;
  
  
  
  public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null)
  
   {
  
  
      $this-&gt;webserviceParameters['associations']['wb3d'] = array('resource'    =&gt; 'wb3d','fields' =&gt; array('directory_name' =&gt; array('required' =&gt; true)));
  
      parent::__construct($id_product, $full, $id_lang, $id_shop, $context);
  
   }
  
  }
  ?&gt;
  </code></pre>
  
  <p>In this <strong>product.php</strong> which is for overriding the <strong>product class</strong> for passing the <strong>extra parameters</strong>  through <strong>webserviceparameters()</strong> and then calling the parent <strong>constructor</strong> of the <strong>product class</strong></p>
  
  <pre><code>    &lt;?php
      class WebserviceRequest extends WebserviceRequestCore
      {
      public static function getResources()
      {
      $resources=parent::getResources();
      $resources['wb3d'] = array('description' =&gt; 'images path', 'class' =&gt;   'ProductMerge');
      ksort($resources);
      return $resources;
      }
      }
      ?&gt;
  </code></pre>
  
  <p><strong>WebserviceRequest.php</strong> class is a override class for the WebserviceRequest class which shows the description of the table entry in the webservice</p>
  
  <p>These are the files which are required to get the things done. <strong>What I'm trying to achieve is the associated table (wb3d) data should be available within the products table through webservice rest api call</strong>. </p>