In the insert you need: (int) $parentId