PHP Classes

File: Config/Queries/ClientDB/POST/Category.php

Recommend this page to a friend!
  Classes of Ramesh Narayan Jangid   Open Swoole Microservices   Config/Queries/ClientDB/POST/Category.php   Download  
File: Config/Queries/ClientDB/POST/Category.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: Open Swoole Microservices
Implement microservices using Open Swoole
Author: By
Last change: Implemented serverMode feature for Read Configs
Date: 1 month ago
Size: 1,620 bytes
 

Contents

Class file image Download
<?php
namespace Microservices\Config\Queries\ClientDB\POST;

use
Microservices\App\Constants;

return [
   
'query' => "INSERT INTO `category` SET __SET__",
   
'__CONFIG__' => [// [{payload/uriParams}, key/index, {Constants::$REQUIRED}]
       
['payload', 'name', Constants::$REQUIRED],
    ],
   
'__SET__' => [
       
//column => [payload|readOnlySession|uriParams|insertIdParams|{custom}, key|{value}],
       
'name' => ['payload', 'name'],
       
'parent_id' => ['custom', 0],
    ],
   
'insertId' => 'category:id',
   
'subQuery' => [
       
'sub' => [
           
'query' => "INSERT INTO `category` SET __SET__",
           
'__CONFIG__' => [// [{payload/uriParams}, key/index, {Constants::$REQUIRED}]
               
['payload', 'subname', Constants::$REQUIRED],
            ],
           
'__SET__' => [
               
'name' => ['payload', 'subname'],
               
'parent_id' => ['insertIdParams', 'category:id'],
            ],
           
'insertId' => 'sub:id',
           
'subQuery' => [
               
'subsub' => [
                   
'query' => "INSERT INTO `category` SET __SET__",
                   
'__CONFIG__' => [// [{payload/uriParams}, key/index, {Constants::$REQUIRED}]
                       
['payload', 'subsubname', Constants::$REQUIRED],
                    ],
                   
'__SET__' => [
                       
'name' => ['payload', 'subsubname'],
                       
'parent_id' => ['insertIdParams', 'sub:id'],
                    ],
                   
'insertId' => 'subsub:id',
                ]
            ]
        ]
    ],
   
'useHierarchy' => true
];