title: add category programmatically prestashop
body: <p>I would like to add categories programmatically to prestashop, i tried this code </p>
  
  <pre><code>$object = new Category();
  
  $object-&gt;name = "xcvxvvx";
  if (!$parent_id){
  $parent_id = Configuration::get('PS_HOME_CATEGORY');
  }
  $object-&gt;id_parent = $parent_id;
  $object-&gt;link_rewrite = array((int)(Configuration::get('PS_LANG_DEFAULT')) =&gt;   $category);
  $object-&gt;add();
  $object-&gt;id_category = $object-&gt;id;
  
  $object-&gt;id_category_default = $object-&gt;id;
  </code></pre>
  
  <p>$object->update();  </p>
  
  <p>I get this error message :</p>
  
  <pre><code>Fatal error: Uncaught exception 'PrestaShopException' with message 'Property
  Category-&gt;name is empty' in /var/www/autospareparts.se.com/classes/ObjectModel.php:874
  Stack trace:
  #0 /var/www/autospareparts.se.com/classes/ObjectModel.php(306):   
  ObjectModelCore-&gt;validateFieldsLang()
  #1 /var/www/autospareparts.se.com/classes/ObjectModel.php(490):  
  ObjectModelCore-&gt;getFieldsLang()
  #2 /var/www/autospareparts.se.com/classes/Category.php(157): 
  ObjectModelCore-&gt;add(true,  false)
  #3 /var/www/autospareparts.se.com/get_product.php(51): CategoryCore-&gt;add()
  #4 {main}
  thrown in /var/www/autospareparts.se.com/classes/ObjectModel.php on line 874
  </code></pre>
  
  <p>error related to name field that i assigned</p>
  
  <pre><code>$object-&gt;name = "xcvxvvx";
  </code></pre>
  
  <p>Thanks in advance</p>