Removes an object to the persistence.

This repository keeps track of added and removed nodes (additionally to the
other Unit of Work) in order to find in-memory nodes.

@param object $object The object to remove
@return void
@api
515125
public function remove($object)
    {
        if ($object instanceof NodeInterface) {
            $object = $object->getNodeData();
        }
        if ($this->addedNodes->contains($object)) {
            $this->addedNodes->detach($object);
        }
        if (!$this->removedNodes->contains($object)) {
            $this->removedNodes->attach($object);
        }
        parent::remove($object);
    }
1050053
public void deleteObject(Object object)
    {
        PersistenceBroker broker = null;
        try
        {
            broker = getBroker();
            broker.delete(object);
        }
        finally
        {
            if (broker != null) broker.close();
        }
    }
21469
public function preRemove($object)
    {
        $this->blockManager->get($object)->preRemove($object);

        $page = $object->getPage();

        if ($page instanceof PageInterface) {
            $page->setEdited(true);
        }
    }
741441
protected function registerDirty(PersistentObject $object) {
    $key = $object->getOID()->__toString();
    // if it was a new or deleted object, we return immediatly
    if (isset($this->newObjects[$key]) || isset($this->deletedObjects[$key])) {
      return $object;
    }
    if (self::$isDebugEnabled) {
      self::$logger->debug("Register dirty object: ".$key);
    }
    $this->dirtyObjects[$key] = $object;
    return $object;
  }
698257
public static function reset($object)
	{
		if (!($object instanceof MethodDescriptorProto)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\MethodDescriptorProto.');
		}
		$object->name = NULL;
		$object->inputType = NULL;
		$object->outputType = NULL;
		$object->options = NULL;
		$object->clientStreaming = NULL;
		$object->serverStreaming = NULL;
	}
985620
public function delete($object)
    {
        $ret = $this->getValidator()->validateDelete($object);
        if ($ret) {
            $ret = $this->_delete($object);
        }
        return $ret;
    }
92590
public function unregisterObject($object)
    {
        unset($this->identifierMap[$this->objectMap[$object]]);
        $this->objectMap->detach($object);
    }
158220
public function deleteObject($object)
    {
        $itemUUID = $this
            ->transformer
            ->toItemUUID($object);

        if ($itemUUID instanceof ItemUUID) {
            $this->deleteItem($itemUUID);
        }
    }
792026
public static function reset($object)
	{
		if (!($object instanceof FileDescriptorProto)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\FileDescriptorProto.');
		}
		$object->name = NULL;
		$object->package = NULL;
		$object->dependency = NULL;
		$object->publicDependency = NULL;
		$object->weakDependency = NULL;
		$object->messageType = NULL;
		$object->enumType = NULL;
		$object->service = NULL;
		$object->extension = NULL;
		$object->options = NULL;
		$object->sourceCodeInfo = NULL;
		$object->syntax = NULL;
	}
198240
final public function deleteObject(Model $object)
    {
        if ($object->isNewRecord()) {
            return;
        }

        $this->onObjectDeleted($object);

        $this->deleteObjectFromCache($object);
    }
661886
public function removeObject(DataObject $object)
    {
        $item = ChangeSetItem::get()->filter([
            'ObjectID' => $object->ID,
            'ObjectClass' => $object->baseClass(),
            'ChangeSetID' => $this->ID
        ])->first();

        if ($item) {
            // TODO: Handle case of implicit added item being removed.

            $item->delete();
        }

        $this->sync();
    }
263252
protected function destroy( ValueObject $object )
    {
        /** @var \eZ\Publish\API\Repository\Repository $repository */
        $repository = $this->getRepository();
        $repository->sudo(
            function() use( $repository, $object )
            {
                $userService = $repository->getUserService();
                try
                {
                    $objectToBeRemoved = $userService->loadUserGroup( $object->id );
                    $userService->deleteUserGroup( $objectToBeRemoved );
                }
                catch ( ApiExceptions\NotFoundException $e )
                {
                    // nothing to do
                }
            }
        );
    }
1084014
public static function reset($object)
	{
		if (!($object instanceof MethodOptions)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\MethodOptions.');
		}
		$object->deprecated = NULL;
		$object->uninterpretedOption = NULL;
	}
1312976
public function remove($object)
    {
        if (!is_object($object) || !($object instanceof $this->objectType)) {
            $type = (is_object($object) ? get_class($object) : gettype($object));
            throw new IllegalObjectTypeException('The value given to remove() was ' . $type . ' , however the ' . get_class($this) . ' can only handle ' . $this->objectType . ' instances.', 1517408067);
        }
        $this->entityManager->remove($object);
    }
317799
public function offsetUnset($object)
       {
            if (parent::contains($object)) {
                parent::offsetUnset($object);
                $index = array_search(spl_object_hash($object), $this->map, true);
                unset($this->map[$index]);
            }
       }
110824
public function deleteAcl($object)
    {
        try {
            if ($objectIdentity = $this->getObjectIdentity($object)) {
                $this->aclProvider->deleteAcl($objectIdentity);
            }
        } catch (\Exception $e) {
            // nothing to do
        }
    }
200798
private function doRemove($object, array &$visited): void
    {
        $oid = spl_object_hash($object);
        if (isset($visited[$oid])) {
            return;
        }

        $visited[$oid] = true;

        // Cascade first to avoid problems with proxy initializing out of the identity map.
        $this->cascadeRemove($object, $visited);

        $class = $this->manager->getClassMetadata(get_class($object));
        $documentState = $this->getDocumentState($object);

        switch ($documentState) {
            case self::STATE_NEW:
            case self::STATE_REMOVED:
                // Nothing to do.
                break;

            case self::STATE_MANAGED:
                $this->lifecycleEventManager->preRemove($class, $object);
                $this->scheduleForDeletion($object);
                break;

            case self::STATE_DETACHED:
                throw new \InvalidArgumentException('Detached document cannot be removed');
            default:
                throw new \InvalidArgumentException('Unexpected document state '.$documentState);
        }
    }