Store object in cache to see changes

@param   object  $object Object to cache
@return  void
178641
public function cacheObject($object)
    {
        if (is_object($object)) {
            $unhyd = $this->hydrator->unhydrate($object);
            unset($unhyd["stream"]);
            $this->objectCache->save(spl_object_hash($object), $unhyd);
        }
    }
1302434
protected function recordObject($object)
	{
		$js      = $this->encoder->encode($object);
		$varName = $this->getVarName($js);

		if ($this->isIterable($object))
		{
			$object = $this->recordObjectContent($object);
		}

		if (!isset($this->configValues[$varName]))
		{
			$this->configValues[$varName] = new ConfigValue($object, $varName);
			$this->jsLengths[$varName]    = strlen($js);
		}
		$this->configValues[$varName]->incrementUseCount();

		return $this->configValues[$varName];
	}
1282345
private function scheduleForInsert($object)
    {
        $oid = spl_object_hash($object);
        $class = $this->manager->getClassMetadata(get_class($object));

        $this->documentInsertions[$oid] = $object;

        if (null !== $class->getSingleIdentifier($object)) {
            $this->addToIdentityMap($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;
	}
727551
public function save(DomainObjectInterface &$domainObject): void
    {
        if ($domainObject->getId() === 0) {
            $this->concreteInsert($domainObject);
        }

        $this->concreteUpdate($domainObject);
    }
657745
final protected function cacheObjectData(Model $object)
    {
        $uniqueIdentifier = $object->UniqueIdentifier;

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

        if (!isset($this->cachedObjectData[$uniqueIdentifier])) {
            $this->cachedObjectData[$uniqueIdentifier] = $object->exportRawData();
        } else {
            $this->cachedObjectData[$uniqueIdentifier] = array_merge(
                $this->cachedObjectData[$uniqueIdentifier],
                $object->exportRawData()
            );
        }
    }
1356926
public function cacheObject($o)
    {
        if (\PHPDaemon\Core\Daemon::$config->logevents->value) {
            \PHPDaemon\Core\Daemon::log(__METHOD__ . '(' . json_encode($o) . ')');
        }

        if (isset($o['_key'])) {
            $this->cache->set($o['_key'], bson_encode($o));
            $this->cache->set('_id.' . ((string)$o['_id']), $o['_key']);
        }

        if (isset($o['_ev'])) {
            $o['name'] = $o['_ev'];

            if (\PHPDaemon\Core\Daemon::$config->logevents->value) {
                \PHPDaemon\Core\Daemon::log('MongoNode send event ' . $o['name']);
            }
        }
    }
948166
public function loadFromArray ($object)
    {
        parent::loadFromArray($object);

        if (!empty($this->recipients->items)) {
            foreach($this->recipients->items AS &$item) {
                $Recipient = new Recipient();
                $Recipient->loadFromArray($item);

                $item = $Recipient;
            }
        }
1065917
public static function persist(IdentifiableObject $object) : void
    {
        self::repositoryFor(\get_class($object))->persist($object);
    }
1279692
private function scheduleForDeletion($object)
    {
        $oid = spl_object_hash($object);
        if (isset($this->documentInsertions[$oid])) {
            if ($this->isInIdentityMap($object)) {
                $this->removeFromIdentityMap($object);
            }

            unset($this->documentInsertions[$oid], $this->documentStates[$oid]);

            return;
        }

        if (! $this->isInIdentityMap($object)) {
            return;
        }

        $this->removeFromIdentityMap($object);
        unset($this->documentUpdates[$oid]);

        $this->documentDeletions[$oid] = $object;
        $this->documentStates[$oid] = self::STATE_REMOVED;
    }
649488
public function remove($object) : void
    {
        $hash = spl_object_hash($object);

        unset($this->objects[$hash]);
        unset($this->data[$hash]);
    }
716818
public function postUpdate($object): void
    {
        /** @var BlockAdmin $block */
        $blockManager = $this->blockManager;

        $block = $blockManager->get($object);
        $block->postUpdate($object);

        $service = $blockManager->get($object);

        $this->cacheManager->invalidate($service->getCacheKeys($object));
    }
848883
public function unshift($object): self
    {
        $this->internalDataListUpdate();
        array_unshift($this->internalDataListData, $object);
        return $this;
    }
817471
public function preUpdate($object): void
    {
        /** @var BlockAdmin $block */
        $block = $this->blockManager->get($object);

        $block->preUpdate($object);

        // fix weird bug with setter object not being call
        $object->setChildren($object->getChildren());

        $dashboard = $object->getDashboard();

        if ($dashboard instanceof DashboardInterface) {
            $dashboard->setEdited(true);
        }
    }
509658
public function preRemove($object): void
    {
        /** @var BlockAdmin $block */
        $block = $this->blockManager->get($object);
        $block->preRemove($object);
    }
868318
private function doPersist($object, array &$visited): void
    {
        $oid = spl_object_hash($object);
        if (isset($visited[$oid])) {
            return;
        }

        $visited[$oid] = true;
        $class = $this->manager->getClassMetadata(get_class($object));

        $documentState = $this->getDocumentState($object, self::STATE_NEW);
        switch ($documentState) {
            case self::STATE_MANAGED:
                break;

            case self::STATE_NEW:
                $this->persistNew($class, $object);
                break;

            case self::STATE_REMOVED:
                unset($this->documentDeletions[$oid]);
                $this->documentStates[$oid] = self::STATE_MANAGED;

                break;
        }

        $this->cascadePersist($object, $visited);
    }
241538
public function addObject(DataObject $object)
    {
        if (!$this->isInDB()) {
            throw new BadMethodCallException("ChangeSet must be saved before adding items");
        }

        if (!$object->isInDB()) {
            throw new BadMethodCallException("Items must be saved before adding to a changeset");
        }

        $references = [
            'ObjectID' => $object->ID,
            'ObjectClass' => $object->baseClass(),
        ];

        // Get existing item in case already added
        $item = $this->Changes()->filter($references)->first();

        if (!$item) {
            $item = new ChangeSetItem($references);
            $this->Changes()->add($item);
        }

        $item->ReferencedBy()->removeAll();

        $item->Added = ChangeSetItem::EXPLICITLY;
        $item->write();

        $this->sync();
    }