Skip to content

Instantly share code, notes, and snippets.

@cholnhial
Created June 16, 2015 08:14
Show Gist options
  • Save cholnhial/1f8a26e9974afce0b3e2 to your computer and use it in GitHub Desktop.
Save cholnhial/1f8a26e9974afce0b3e2 to your computer and use it in GitHub Desktop.
PatchEntities only patches one entity in the list
{
/*#1 This is the data being used to patch,it's from $this->requests->data['data'] */
"data": [
{
"created": "6\/10\/15, 6:11 AM",
"updated": "",
"is_disabled": "0",
"fabric_colour_id": "107",
"name": "Athena",
"fabric_id": "8",
"stock": "1203",
"incoming_stock": "0",
"price": "0.0000"
},
{
"created": "6\/10\/15, 6:11 AM",
"updated": "",
"is_disabled": "0",
"fabric_colour_id": "1494",
"name": "Chol",
"fabric_id": "8",
"stock": "25",
"incoming_stock": "12",
"price": "32.0000"
},
{
"created": "6\/10\/15, 6:11 AM",
"updated": "",
"is_disabled": "0",
"fabric_colour_id": "1495",
"name": "Black",
"fabric_id": "8",
"stock": "12",
"incoming_stock": "32",
"price": "20.4500"
}
],
/*#2 This is what is returned by patchEntities, only one */
"fabricColours": [
{
"fabric_colour_id": 107,
"name": "Athena",
"price": "0.0000",
"stock": "1203",
"incoming_stock": "0",
"is_disabled": 0,
"fabric_id": 8,
"created": "2015-06-10T06:11:43+0000",
"updated": null
}
],
/*#3 This is thee list being patch */
"list": [
{
"fabric_colour_id": 107,
"name": "Athena",
"price": "0.0000",
"stock": "1203",
"incoming_stock": "0",
"is_disabled": 0,
"fabric_id": 8,
"created": "2015-06-10T06:11:43+0000",
"updated": null
},
{
"fabric_colour_id": 1494,
"name": "Chol",
"price": 32,
"stock": 25,
"incoming_stock": 12,
"is_disabled": null,
"fabric_id": 8,
"created": "2015-06-11T00:19:30+0000",
"updated": null
},
{
"fabric_colour_id": 1495,
"name": "Black",
"price": 20.45,
"stock": 12,
"incoming_stock": 32,
"is_disabled": null,
"fabric_id": 8,
"created": "2015-06-11T00:20:01+0000",
"updated": null
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment