public function savePcBlogCategoriesPostsList($con = null) { if (!$this->isValid()) { throw $this->getErrorSchema(); } if (!isset($this->widgetSchema['pc_blog_categories_posts_list'])) { // somebody has unset this widget return; } if (null === $con) { $con = $this->getConnection(); } $c = new Criteria(); $c->add(PcBlogCategoriesPostsPeer::POST_ID, $this->object->getPrimaryKey()); PcBlogCategoriesPostsPeer::doDelete($c, $con); $values = $this->getValue('pc_blog_categories_posts_list'); if (is_array($values)) { foreach ($values as $value) { $obj = new PcBlogCategoriesPosts(); $obj->setPostId($this->object->getPrimaryKey()); $obj->setCategoryId($value); $obj->save(); } } }