protected function updateItem($name, $item)
{
if ($item->name !== $name) {
$this->db->getCollection($this->assignmentCollection)->update(['item_name' => $name], ['item_name' => $item->name]);
$this->db->getCollection($this->itemCollection)->update(['parents' => ['$in' => [$item->name]]], ['$pull' => ['parents' => ['$in' => [$item->name]]]], ['multi' => true]);
$this->db->getCollection($this->itemCollection)->update(['parents' => ['$in' => [$item->name]]], ['$push' => ['parents' => $name]], ['multi' => true]);
}
$item->updatedAt = time();
$this->db->getCollection($this->itemCollection)->update(['name' => $name], ['name' => $item->name, 'description' => $item->description, 'rule_name' => $item->ruleName, 'data' => $item->data === null ? null : serialize($item->data), 'updated_at' => $item->updatedAt]);
$this->invalidateCache();
return true;
}