Removes an object instance.

A removed object will be removed from the database as a result of the flush operation.

@param object $object
345852
public function remove($object)
    {
        $this
            ->objectManager
            ->remove($object);

        $this
            ->objectManager
            ->flush($object);
    }
998795
public void remove (Object object) {
		if (!idToObject.containsValue(object, true)) return;
		int objectID = idToObject.findKey(object, true, -1);
		idToObject.remove(objectID);
		objectToID.remove(object, 0);
		if (TRACE) trace("kryonet", "Object " + objectID + " removed from ObjectSpace: " + object);
	}
387270
public static function reset($object)
	{
		if (!($object instanceof ServiceDescriptorProto)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\ServiceDescriptorProto.');
		}
		$object->name = NULL;
		$object->method = NULL;
		$object->options = NULL;
	}
1283873
public function postRemove($object): void
    {
        /** @var BlockAdmin $block */
        $block = $this->blockManager->get($object);
        $block->postRemove($object);
    }
985620
public function delete($object)
    {
        $ret = $this->getValidator()->validateDelete($object);
        if ($ret) {
            $ret = $this->_delete($object);
        }
        return $ret;
    }
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);
        }
    }
541237
protected function unsetCacheObject($object, $clearCacheDir = true)
    {
        $objectId       = isset($object->id) ? $object->id : '';
        $objectFilename = isset($object->file->name->disk) ? $object->file->name->disk : '';
        $bucketId       = isset($object->bucket->id) ? $object->bucket->id : '';
        $bucketSlug     = isset($object->bucket->slug) ? $object->bucket->slug : '';

        // --------------------------------------------------------------------------

        $this->unsetCache('object-' . $objectId);
        $this->unsetCache('object-' . $objectFilename);
        $this->unsetCache('object-' . $objectFilename . '-' . $bucketId);
        $this->unsetCache('object-' . $objectFilename . '-' . $bucketSlug);

        // --------------------------------------------------------------------------

        //  Clear out any cache files
        if ($clearCacheDir) {

            // Create a handler for the directory
            $pattern = '#^' . $bucketSlug . '-' . substr($objectFilename, 0, strrpos($objectFilename, '.')) . '#';
            $fh      = @opendir(static::CACHE_PATH);

            if ($fh !== false) {

                // Open directory and walk through the file names
                while ($file = readdir($fh)) {

                    // If file isn't this directory or its parent, add it to the results
                    if ($file != '.' && $file != '..') {

                        // Check with regex that the file format is what we're expecting and not something else
                        if (preg_match($pattern, $file) && file_exists(static::CACHE_PATH . $file)) {
                            unlink(static::CACHE_PATH . $file);
                        }
                    }
                }
            }
        }
    }
649105
public function delete($object)
    {
        try {
            $this->dm->remove($object);
            $this->dm->flush();
        } catch (\Exception $e) {
            throw new ModelManagerException('', 0, $e);
        }
    }
239492
function stop_object($object) {

    if ( !isset($this->_objs[$object]) )
      return;

    $start = $this->_objs[$object]["start_page"];
    $where = $this->_objs[$object]["where"];

    // Place the object on this page if required
    if ( $this->_page_number >= $start &&
         (($this->_page_number % 2 == 0 && $where === "even") ||
          ($this->_page_number % 2 == 1 && $where === "odd") ||
          ($where === "all")) )
      $this->_pdf->fit_image($object,0,0,"");

    $this->_objs[$object] = null;
    unset($this->_objs[$object]);
  }
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;
  }
889007
function(object) {
            this.map.remove(object.x, object.y);
            var index = this.objects.indexOf(object);
            this.objects.splice(index, 1);
            if(object.onRemove){
                object.onRemove();
            }
        }
509658
public function preRemove($object): void
    {
        /** @var BlockAdmin $block */
        $block = $this->blockManager->get($object);
        $block->preRemove($object);
    }
1354695
protected function destroy( ValueObject $object )
    {
         /** @var \eZ\Publish\API\Repository\Repository $repository */
        $repository = $this->getRepository();
        $contentId = $object->id;
        $repository->sudo(
            function() use( $repository, $contentId )
            {
                try
                {
                    $contentService = $repository->getContentService();
                    $contentInfo = $contentService->loadContentInfo( $contentId );
                    $contentService->deleteContent( $contentInfo );
                }
                catch ( ApiExceptions\NotFoundException $e )
                {
                    // Nothing to do
                }
            }
        );
    }
525486
public function applyTo($object)
	{
		foreach($this->toArray() as $key=>$value)
			$object->$key=$value;
	}
1302126
public static function isDeleted($object)
    {
        if (true === method_exists($object, 'getDeleted') && true === $object->getDeleted()) {
            return true;
        }

        if (true === method_exists($object, 'isDeleted') && true === $object->isDeleted()) {
            return true;
        }

        return false;
    }
604019
@Override
  public boolean remove(Object object) {
    if (object == null) {
      return false;
    }
    // Locking this object protects against removing the exact object that might be in the
    // process of being added, but does not protect against removing a distinct, but equivalent
    // object.
    synchronized (object) {
      if (mPrimaryIndex.containsObject((T) object)) {
        // This isn't technically typesafe. However, given that success is true, it's very unlikely
        // that the object passed to remove is not of type <T>.
        @SuppressWarnings("unchecked")
        T tObj = (T) object;
        removeFromIndices(tObj);
        return true;
      } else {
        return false;
      }
    }
  }
1330831
final protected function deleteObjectFromCache(Model $object)
    {
        $uniqueIdentifier = $object->UniqueIdentifier;

        if ($uniqueIdentifier === null) {
            return;
        }

        if (isset($this->cachedObjectData[$uniqueIdentifier])) {
            unset($this->cachedObjectData[$uniqueIdentifier]);
        }
    }