It is not possible to change the working directory because its constant. To work around this problem, you may not use the ContentModelArticle at all and use only the table class instead:
$table = JTable::getInstance('Content', 'JTable', array()); $data = array( 'catid' => 1, 'title' => 'SOME TITLE', 'introtext' => 'SOME TEXT', 'fulltext' => 'SOME TEXT', 'state' => 1, );
Please note that the above code does not fire events before and after saving. However, if necessary, it should not be a problem to trigger these events. It is also worth noting that the published_up field will not be automatically set, and articles in this category will not be reordered.
To reorder categories:
$table->reorder('catid = '.(int) $table->catid.' AND state >= 0');
source share