Remove an element without preRemove and postRemove actions

@param BaseResource $object
@param boolean $flushed
@return BaseResource
328914
public function removeWithoutPreAndPostRemove($object, $flushed = true)
    {
        $em = $this->getEntityManager();
        $em->remove($object);
        if ($flushed) {
            $em->flush($object);
        }
        return $object;
    }
525772
public function persistWithoutPreAndPostPersist($object, $flushed = true)
    {
        $em = $this->getEntityManager();
        $em->persist($object);
        if ($flushed) {
            $em->flush($object);
        }
        return $object;
    }
1073648
public function strip_empty_keys($object){

		$json = json_encode($object);
		$json = preg_replace('/,\s*"[^"]+":null|"[^"]+":null,?/', '', $json);
		$object = json_decode($json);

		return $object;
    }
120165
public function persist($object, $flushed = true)
    {
        $this->prePersist($object);
        $em = $this->getEntityManager();
        $em->persist($object);
        if ($flushed) {
            $em->flush($object);
        }
        $this->postPersist($object);
        return $object;
    }
653378
public function remove($object, $flush = true)
    {
        $this->isExpectedObject($object);
        $this->objectManager->remove($object);
        if ($flush) {
            $this->flush();
        }
    }
813312
public function updatePositionForSiblingsElements($object, $removed = false)
    {

        if (!is_null($object->getParent())) {
            $children = $this->findChildrenByParentId($object->getParent()->getId());
            $i = 1;
            $f = false;
            foreach ($children as $ch) {
                if ($removed && $ch->getId() != $object->getId()) {
                    $ch->setPosition($i);
                    $this->updateWithoutPreAndPostUpdate($ch);
                    $i++;
                } else if (!$removed) {
                    if (!$f && $ch->getPosition() >= $object->getPosition()) {
                        $f = true;
                        $object->setPosition($i);
                        if ($ch->getId() != $object->getId()) {
                            $ch->setPosition($i + 1);
                            $i++;
                        }
                    } else if ($ch->getId() != $object->getId()) {
                        $ch->setPosition($i);
                    }
                    $this->updateWithoutPreAndPostUpdate($ch);
                    $i++;
                }
            }
        }

        return true;
    }
110526
public function removeObject($object)
    {
        $oid = spl_object_hash($object);
        $data = [];
        if (isset($this->objectsRepository[$oid])) {
            $repository = $this->objectsRepository[$oid];
            $data = $repository->getHydrator()->unhydrate($object);
        }
        $id = isset($data['_id']) ? serialize($data['_id']) . $repository->getCollection() : $oid;

        if (!isset($this->objectStates[$id])) {
            throw new Exception\StateException("Can't remove object, it does not be managed");
        }

        unset($this->objectStates[$id]);
        unset($this->objects[$id]);
        unset($this->objectsRepository[$id]);
        unset($this->objectStates[$oid]);
        unset($this->objects[$oid]);
        unset($this->objectsRepository[$oid]);
    }
903308
static function remove($object)
	{
		$db = new driver_mysql(config('main_bors_db'));

		$where = array(
			'target_class_id IN' => array($object->class_id(), $object->extends_class_id()),
			'target_object_id' => $object->id(),
		);

		bors_debug::syslog('__keywords_delete', 'where='.print_r($where, true));
		$db->delete('bors_keywords_index', $where);
	}
535244
public function delete(User $user, $flush = true)
    {
        $this->cleanProperties($user);
        $this->cleanRights($user);

        $this->objectManager->persist($user);

        if ($flush) {
            $this->objectManager->flush();
            $this->objectManager->clear(ApiLog::class);
        }
    }
315061
public void remove(@NonNull T object) {
        synchronized (mLock) {
            final int position = getPosition(object);
            final boolean removed = mObjects.remove(object);
            if (removed) {
                notifyItemRemoved(position);
            }
        }

    }
848883
public function unshift($object): self
    {
        $this->internalDataListUpdate();
        array_unshift($this->internalDataListData, $object);
        return $this;
    }
26600
public void removedLastSubscriber (DObject obj, boolean deathWish)
    {
        // if this object has a registered flush delay, don't can it just yet, just slip it onto
        // the flush queue
        Class<?> oclass = obj.getClass();
        for (Class<?> dclass : _delays.keySet()) {
            if (dclass.isAssignableFrom(oclass)) {
                long expire =  System.currentTimeMillis() + _delays.get(dclass).longValue();
                _flushes.put(obj.getOid(), new FlushRecord(obj, expire));
//                 Log.info("Flushing " + obj.getOid() + " at " + new java.util.Date(expire));
                return;
            }
        }

        // if we didn't find a delay registration, flush immediately
        flushObject(obj);
    }
54643
public function delete($entity, $flush = true)
    {
        $this->getEntityManager()->remove($entity);

        if ($flush) {
            $this->getEntityManager()->flush();
        }
        return $this;
    }
217579
public function remove( common_Object $object)
    {
        $returnValue = (bool) false;

        
        foreach($this->sequence as $index => $_node){
			if($_node === $object){
				unset($this->sequence[$index]);
				$this->sequence = array_values($this->sequence);
				return true;
			}		
		}
		return false;
        

        return (bool) $returnValue;
    }
509658
public function preRemove($object): void
    {
        /** @var BlockAdmin $block */
        $block = $this->blockManager->get($object);
        $block->preRemove($object);
    }
548588
public function update($object, $flushed = true)
    {
        $this->preUpdate($object, $flushed);
        $em = $this->getEntityManager();
        $em->persist($object);
        if ($flushed) {
            $em->flush($object);
        }
        $this->postUpdate($object, $flushed);
        return $object;
    }
649105
public function delete($object)
    {
        try {
            $this->dm->remove($object);
            $this->dm->flush();
        } catch (\Exception $e) {
            throw new ModelManagerException('', 0, $e);
        }
    }