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();
         }
     }
 }
 public static function initialize($idU, $idD, $idS, $idN = NivellsPeer::CAP)
 {
     $O = AppDocumentsPermisosDirPeer::retrieveByPK($idU, $idD);
     if (!$O instanceof AppDocumentsPermisosDir) {
         $O = new AppDocumentsPermisosDir();
         $O->setidusuari($idU);
         $O->setIddirectori($idD);
         $O->setIdnivell($idN);
         $O->setSiteId($idS);
         $O->setActiu(true);
     }
     return new AppDocumentsPermisosDirForm($O, array('app' => AppsPeer::APP_DOCUMENTS, 'IDS' => $idS));
 }