- var_export: documentation ( source)
- array_keys: documentation ( source)
- range: documentation ( source)
<?php
function isObject($value)
{
return
is_object($value) ||
(is_array($value) && (count($value) == 0 || isAssociativeArray($value)));
}
function isAssociativeArray($arr)
{
return array_keys($arr) !== range(0, count($arr) - 1);
}
function arrayToObjectRecursive($array)
{
foreach ($array as &$value) {
if (is_array($value)) {
$value = arrayToObjectRecursive($value);
}
}
return isObject($array) ? (object) $array : $array;
}
$r = arrayToObjectRecursive([
"appraisalData"=> [
"type"=> "boolean",
"description"=> "Valuation data for this product in different conditions"
],
"asstNum"=> [
"type"=> "boolean",
"description"=> "The assortment number of this product."
],
"briefReleaseDesc"=> [
"type"=> "boolean",
"description"=> "A brief description of the sku's release history."
],
"collectionItems"=> "/api/schema/collect/output.json",
"comment"=> [
"type"=> "boolean",
"description"=> "Editorial comment for this sku"
],
"dateAdded"=> [
"type"=> "boolean",
"description"=> "The date this sku was added to the database (timestamp)"
],
"description"=> [
"type"=> "boolean",
"description"=> "The copy from the packaging"
],
"detailsUrl"=> [
"type"=> "boolean",
"description"=> "The URL of the details page for this sku"
],
"formattedUpc"=> [
"type"=> "boolean",
"description"=> "UPC code, with any appropriate hyphens added.",
"maxLength"=> 16
],
"fullName"=> [
"type"=> "boolean",
"description"=> "A concatenation of the name of the sku, and its variant descriptor"
],
"gallery"=> [
"type"=> "object",
"description"=> "Choose the photo information you want to get back. Only photos that have been reviewed will be returned.",
"additionalProperties"=> false,
"properties"=> [
'$ref'=>"/api/schema/photos/output.json"
]
],
"groups"=> [
"type"=> "boolean",
"description"=> "A list of the groups for this product. Each group contains a list of part ids and the number of times each part appears in that group. For the parts themselves, include 'parts'"
],
"inWishlist"=> [
"type"=> "boolean",
"description"=> "Returns true if this sku is in the wishlist of the logged-in user, false otherwise."
],
"isReleased"=> [
"type"=> "boolean",
"description"=> "True if at least one of the release is not upcoming."
],
"itemNum"=> [
"type"=> "boolean",
"description"=> "Item number of this sku."
],
"limited"=> [
"type"=> "boolean",
"description"=> "The number of items this sku was limited to"
],
"manufacturer"=> [
"type"=> "boolean",
"description"=> "The manufacturer of this sku"
],
"modifyUrl"=> [
"type"=> "boolean",
"description"=> "The URL of the modiy page for this sku"
],
"mods"=> [
"type"=> [
"number",
"boolean"
],
"description"=> "The uid of a shmax user. If this user has any submissions pending for this sku, then information detailing his changes will be returned"
],
"name"=> [
"type"=> "boolean",
"description"=> "The name of the sku"
],
"nameSort"=> [
"type"=> "boolean",
"description"=> "The internal string used when sorting by name. Not to be exposed to user."
],
"numCollected"=> [
"type"=> "boolean",
"description"=> "The number of times this product appears in the collections of shmax users"
],
"package"=> [
"type"=> "boolean",
"description"=> "The pacakaging this sku came in."
],
"parts"=> [
"description"=>"Specify the part information you'd like to get back.",
"type"=>"object",
"properties"=> [
'$ref'=> "/api/schema/parts/output.json"
]
],
"photoBack"=> [
"type"=>"object",
"description"=>"Information about the back photo",
"properties"=>[
'$ref'=> "/api/schema/photos/output.json"
]
],
"photoFront"=> [
"type"=>"object",
"description"=>"Information about the front photo",
"properties"=>[
'$ref'=> "/api/schema/photos/output.json"
]
],
"productId"=> [
"type"=> "boolean",
"description"=> "The branding product prefix number, if any. Common with Japanese toys."
],
"productIdClean"=> [
"type"=> "boolean",
"description"=> "The internal, minimized, sort-friendly version of the product id. Not to be exposed to user."
],
"releaseDateKnown"=> [
"type"=> "boolean",
"description"=> "True if at least one of the release dates is fully resolved (ie. has year, month and date filled-in)"
],
"releases"=> [
'$ref'=> "/api/schema/releases/output.json"
],
"relevance"=> [
"type"=> "boolean",
"description"=> "A score when doing a full text search."
],
"skuId"=> [
"type"=> "boolean",
"description"=> "Unique numeric identifier for the sku."
],
"skutoylines" => [
"type" => ["object","boolean"],
"description" => "Specify the proeprties of each skutoyline you'd like to get back (or false for nothing)",
"properties"=>[
'$ref'=>"/api/schema/skutoylines/output.json"
]
],
"status"=> [
"type"=> "boolean",
"description"=> "Whether the sku is live on the site, or still waiting for a reviewer to approve its creation."
],
"stores"=> [
"type"=> "boolean",
"description"=> "A list of ids of the stores this product is exclusive to."
],
"submitter"=> [
'$ref'=> "/api/schema/users/output.json"
],
"upc"=> [
"type"=> "boolean",
"description"=> "Universal Product code of this sku"
],
"values"=> [
"type"=> "boolean",
"description"=> "Appraisal data for this sku."
],
"variantDesc"=> [
"type"=> "boolean",
"description"=> "A concatenation of the name of the sku, and its variant descriptor"
],
"variantDesc"=> [
"type"=> "boolean",
"description"=> "Variant descriptor"
],
"variantOf"=> [
"type"=> "boolean",
"description"=> "Id of the sku that this sku is a variant of"
],
"version"=> [
"type"=> "boolean",
"description"=> "An integer version. Incremented each time the sku is updated."
],
"vitals"=> [
"type"=> "boolean",
"description"=> "The dynamically-generated search keywords for this sku. For debugging only."
],
"reissueOf"=>[
"description"=>"Specify the information you will get back for the sku that this sku is a reissue of",
"properties"=>[
'$ref'=>"/api/schema/skus/output.json"
]
],
"reissues"=>[
"description"=>"Specify the information you will get back for the skus that reissues of this sku",
"properties"=>[
'$ref'=>"/api/schema/skus/output.json"
]
],
"variantOf"=>[
"description"=>"Specify the information you will get back for the sku that this sku is a variant of",
"properties"=>[
'$ref'=>"/api/schema/skus/output.json"
]
],
"variants"=>[
"description"=>"Specify the information you will get back for the skus that variants of this sku",
"properties"=>[
'$ref'=>"/api/schema/skus/output.json"
]
]
]);
var_export($r);
This script was stopped while abusing our resources