public function get($business_id)
 {
     $attributes = $this->getBusinessDetails($business_id);
     $core_attributes_schema = $this->_core_attributes_schema;
     $output = array();
     //Setting all Core Attributes
     $this->copyAttributesToArray($attributes, $core_attributes_schema, $output);
     //Setting all Business Specific Attributes
     $business_categories = $output["business_category"];
     foreach ($business_categories as $index => $business_category) {
         $exists = BusinessAttributesSchema::doesBusinessCategorySchemaExist($business_category);
         if ($exists === FALSE) {
             continue;
         }
         $schema_file_name = BusinessAttributesSchema::getBusinessSchemaName($business_category);
         $business_schema = new BusinessAttributesSchema($schema_file_name);
         $this->copyAttributesToArray($attributes, $business_schema, $output);
     }
     return $output;
 }
<?php

require_once "config.php";
use citibytes\UISchema;
use citibytes\BusinessAttributesSchema;
$json = $_REQUEST["json"];
//$json = file_get_contents("testdata/business_categories.json");
$business_categories = json_decode($json, TRUE);
$business_categories = $business_categories["business_categories"];
foreach ($business_categories as $business_category) {
    $business_schema_name = BusinessAttributesSchema::getBusinessSchemaName($business_category);
    if (is_null($business_schema_name) === FALSE) {
        $ui_schema = new UISchema($business_schema_name);
        $ui_schema = $ui_schema->generate();
        $output = array("status" => "success", "schema" => $ui_schema, "schema_name" => $business_schema_name);
        echo json_encode($output);
        return;
    }
}
$output = array("status" => "failed");
echo json_encode($output);
?>