public function saveBlogCategoryArticleList($con = null) { if (!$this->isValid()) { throw $this->getErrorSchema(); } if (!isset($this->widgetSchema['blog_category_article_list'])) { // somebody has unset this widget return; } if (is_null($con)) { $con = $this->getConnection(); } $c = new Criteria(); $c->add(BlogCategoryArticlePeer::CATEGORY_ID, $this->object->getPrimaryKey()); BlogCategoryArticlePeer::doDelete($c, $con); $values = $this->getValue('blog_category_article_list'); if (is_array($values)) { foreach ($values as $value) { $obj = new BlogCategoryArticle(); $obj->setCategoryId($this->object->getPrimaryKey()); $obj->setArticleId($value); $obj->save(); } } }