I have follow php code ("copy order"):
$sourceOrdersList = ordersListUsers::findFirst(array(
'ordersListId = :ordersListId: AND userId = :userId:',
'bind' => array (
'ordersListId' => $ordersListId,
'userId' => $user->id
),
))->getOrdersList();
if ($sourceOrdersList) {
$newOrdersList = $sourceOrdersList;
$newOrdersList->id = null;
$newOrdersList->save();
var_dump($newOrdersList->toarray());
var_dump($sourceOrdersList->toarray());
exit;
var_dump output:
array(2) {
["id"]=>
string(4) "5338"
["label"]=>
string(1) "0"
}
array(2) {
["id"]=>
string(4) "5338"
["label"]=>
string(1) "0"
}
Why "id" the same in both output?
$sourceOrdersList also modifical?
Phalcon 3.0.4 config: https://yadi.sk/i/8XOVHEfP3JfPyo