public function scheduleReorder($document, $srcName, $targetName, $before)
{
$oid = spl_object_hash($document);
$state = $this->getDocumentState($document);
switch ($state) {
case self::STATE_REMOVED:
throw new InvalidArgumentException('Removed document passed to reorder(): ' . self::objToStr($document, $this->dm));
case self::STATE_DETACHED:
throw new InvalidArgumentException('Detached document passed to reorder(): ' . self::objToStr($document, $this->dm));
}
if (!isset($this->scheduledReorders[$oid])) {
$this->scheduledReorders[$oid] = array();
}
$this->scheduledReorders[$oid][] = array($document, $srcName, $targetName, $before);
}