
Why can't I use mxArticle:replace() after using mxArticle::reset()?
The reason is that mxArticle::reset() will reset the entire object including the id of the article object. Hence, mxArticle::replace() will fail since the article's id to replace is not known.
<?php
$program = $_mxPub->factory($programID, MX_OBJECT_PROGRAM);
$article = $program->getArticle($articleID);
$article->reset();
$article->name = 'John Doe';
if (!$article->replace()) {
echo "Unable to replace article! ".$article->getLastErrorMessage();
}
?>
MXAE Release News
MXAE 2.7.5 Released ![]() |
![]() |
Tips & Tricks
The "nocache" attribute ![]() |
![]() |