PHP Classes

File: public_html/Config/Queries/Auth/ClientDB/Groups/UserGroup/POST/Registration-With-Address.php

Recommend this page to a friend!
  Classes of Ramesh Narayan Jangid (Sharma)   PHP Microservices Framework   public_html/Config/Queries/Auth/ClientDB/Groups/UserGroup/POST/Registration-With-Address.php   Download  
File: public_html/Config/Queries/Auth/ClientDB/Groups/UserGroup/POST/Registration-With-Address.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: PHP Microservices Framework
Setup microservices apps with configuration arrays
Author: By
Last change: refactor
refactor
Date: Yesterday
Size: 2,536 bytes
 

Contents

Class file image Download
<?php

/**
 * API Query config
 * php version 8.3
 *
 * @category API_Query_Config
 * @package Microservices
 * @author Ramesh N Jangid <[email protected]>
 * @copyright 2025 Ramesh N Jangid
 * @license MIT https://opensource.org/license/mit
 * @link https://github.com/polygoncoin/Microservices
 * @since Class available since Release 1.0.0
 */

namespace Microservices\public_html\Config\Queries\Auth\ClientDB\Groups\UserGroup\POST;

return [
   
'__QUERY__' => "INSERT INTO `{$Env::$clientUsersTable}` SET __SET__",
   
'__SET__' => [
        [
           
'column' => 'firstname',
           
'fetchFrom' => 'payload',
           
'fetchFromValue' => 'firstname'
       
],
        [
           
'column' => 'lastname',
           
'fetchFrom' => 'payload',
           
'fetchFromValue' => 'lastname'
       
],
        [
           
'column' => 'email',
           
'fetchFrom' => 'payload',
           
'fetchFromValue' => 'email'
       
],
        [
           
'column' => 'username',
           
'fetchFrom' => 'payload',
           
'fetchFromValue' => 'username'
       
],
        [
           
'column' => 'password_hash',
           
'fetchFrom' => 'function',
           
'fetchFromValue' => function($session): string {
                return
password_hash(
                   
password: $session['payload']['password'],
                   
algo: PASSWORD_DEFAULT
               
);
            }
        ],
        [
           
'column' => 'allowed_cidrs',
           
'fetchFrom' => 'custom',
           
'fetchFromValue' => '0.0.0.0/0'
       
],
        [
           
'column' => 'group_id',
           
'fetchFrom' => 'custom',
           
'fetchFromValue' => '1'
       
],
    ],
   
'__INSERT-IDs__' => 'registration:id',
   
'__SUB-QUERY__' => [
       
'address' => [
           
'__QUERY__' => 'INSERT INTO `address` SET __SET__',
           
'__SET__' => [
                [
                   
'column' => 'user_id',
                   
'fetchFrom' => '__INSERT-IDs__',
                   
'fetchFromValue' => 'registration:id'
               
],
                [
                   
'column' => 'address',
                   
'fetchFrom' => 'payload',
                   
'fetchFromValue' => 'address'
               
]
            ],
           
'__INSERT-IDs__' => 'address:id',
           
'__PAYLOAD-TYPE__' => 'Array',
           
'__MAX-PAYLOAD-OBJECTS__' => 2
       
]
    ],
   
'useHierarchy' => true,
   
'__PAYLOAD-TYPE__' => 'Object',
   
'idempotentWindow' => 10
];