Example #1
0
    $u->setCellphone(fRequest::encode('cellphone', 'string'));
    $u->setNextel(fRequest::encode('nextel', 'string'));
    $u->setNextel(fRequest::encode('fax', 'string'));
    $u->setNextel(fRequest::encode('address', 'string'));
    $u->store();
} catch (Exception $e) {
    die('El correo electrónico ya está asociado con una cuenta' . $e->getMessage());
}
$regions = array_unique(fRequest::encode('region', 'array'));
$permissions = array_unique(fRequest::encode('permission', 'array'));
try {
    foreach ($regions as $item) {
        if (!empty($item) && $item != 'null') {
            $ur = new UserRegion();
            $ur->setIdUser($u->getIdUser());
            $ur->setIdRegion($item);
            $ur->store();
        }
    }
    foreach ($permissions as $item) {
        if (!empty($item) && $item != 'null') {
            $up = new UserPermission();
            $up->setIdUser($u->getIdUser());
            $up->setIdPermission($item);
            $up->store();
        }
    }
} catch (Exception $e) {
    die($e->getMessage());
}
die('1');