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();
         }
     }
 }
Пример #2
0
 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));
 }
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      AppDocumentsPermisosDir $value A AppDocumentsPermisosDir object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(AppDocumentsPermisosDir $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = serialize(array((string) $obj->getIdusuari(), (string) $obj->getIddirectori()));
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }