PHP Classes

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

Recommend this page to a friend!
  Classes of Ramesh Narayan Jangid   PHP Microservices Framework   Config/Queries/ClientDB/POST/Category.php   Download  
File: Config/Queries/ClientDB/POST/Category.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Microservices Framework
Setup microservices apps with configuration arrays
Author: By
Last change: Refactor
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
];