Is this a metaphor?


I wept over him, and said, “O my child! perhaps they will leave you in some cold cabin to die, and then throw you into a hole, as if you were a dog.”


Yes, it has used both metaphor and simile. The “cold cabin” and “hole” are metaphor for something suffocating and restricting child from living. The final clause, “as if you were a dog” is a simile, using as to compare child to a dog.