public function scheduleForInsert($xmlEntity)
{
$oid = spl_object_hash($xmlEntity);
if (isset($this->entityUpdates[$oid])) {
throw new \InvalidArgumentException("Dirty xml entity can not be scheduled for insertion.");
}
if (isset($this->entityDeletions[$oid])) {
throw new \InvalidArgumentException("Removed xml entity can not be scheduled for insertion.");
}
if (isset($this->entityInsertions[$oid])) {
throw new \InvalidArgumentException("Xml entity can not be scheduled for insertion twice.");
}
$this->entityInsertions[$oid] = $xmlEntity;
if (isset($this->entityIdentifiers[$oid])) {
$this->addToIdentityMap($xmlEntity);
}
}