Hey it try to convert simple object from js to php and get errors.
This is the array of object:
"signatures": [
{
"id": 5,
"flowID": 1,
"fileID": 1,
"type": "partner",
"page": 1,
"position": {
"x": 444,
"y": 111
},
"size": {
"width": 555,
"height": 321
}
}, {
"id": 6,
"flowID": 1,
"fileID": 1,
"type": "partner",
"page": 1,
"position": {
"x": 444,
"y": 111
},
"size": {
"width": 555,
"height": 321
}
}]
My converted php code:
class Signatures
{
public $id;
public $flowID;
public $fileID;
public $type;
public $page;
public $position;
public $size;
}
$signature = new Signatures();
$signature->id = 5;
$signature->flowID = 1;
$signature->fileID = 1;
$signature->type = 'partner';
$signature->position->x = 50;
$signature->position->y = 50;
$signature->size->height = 200;
$signature->size->width = 200;
How to make to position and size nested in php? I try to create new class but the problem that i cant create properties of "size" and "position". Thanks its my first time on php.
Error:
Warning: Creating default object from empty value in /Users/baruchmashasha/Sites/index.php on line 25
Warning: Creating default object from empty value in /Users/baruchmashasha/Sites/index.php on line 27