Exemplo n.º 1
0
 /**
  * Operaciones de carga y busqueda de los permisos de los que dispone el grupo
  * Guarda un modulo/accion en el array de permisos del grupo y los guarda en la BD
  * 
  */
 public function anadirPermiso($modulo, $accion, $cargarArray = true)
 {
     if (!$this->_estaPermiso($modulo, $accion)) {
         $mi_permiso = new GrupoModulo();
         $mi_permiso->setModulo($modulo);
         $mi_permiso->setAccion($accion);
         $mi_permiso->setGrupo($this);
         $mi_permiso->setPermiso(TRUE);
         $mi_permiso->save();
         if ($cargarArray) {
             $this->_anadirPermiso($mi_permiso, false);
         }
     }
 }
 /**
  * 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      GrupoModulo $value A GrupoModulo object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(GrupoModulo $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = serialize(array((string) $obj->getModulo(), (string) $obj->getAccion(), (string) $obj->getIdGrupo()));
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }