public function saveAppDocumentsPermisosDirList($con = null) { if (!$this->isValid()) { throw $this->getErrorSchema(); } if (!isset($this->widgetSchema['app_documents_permisos_dir_list'])) { // somebody has unset this widget return; } if (null === $con) { $con = $this->getConnection(); } $c = new Criteria(); $c->add(AppDocumentsPermisosDirPeer::IDDIRECTORI, $this->object->getPrimaryKey()); AppDocumentsPermisosDirPeer::doDelete($c, $con); $values = $this->getValue('app_documents_permisos_dir_list'); if (is_array($values)) { foreach ($values as $value) { $obj = new AppDocumentsPermisosDir(); $obj->setIddirectori($this->object->getPrimaryKey()); $obj->setIdusuari($value); $obj->save(); } } }