@param mixed $object

@return mixed|void

@throws ModelManagerException
436355
public function prePersist($object)
    {
        /** @var ContentInterface $contentObject */
        if ($contentObject = $object->getContent()) {
            try {
                $this->getModelManager()->create($contentObject);
                $object->setObjectId($contentObject->getId());
                $this->autoPageDraft($object->getPage());
            } catch (ModelManagerException $e) {
                throw new ModelManagerException($this->trans('Cannot create content, object is invalid', [], 'validators'));
            }
        }
    }
612288
public function load($object)
    {
        if (get_class($object) !== $this->objectClass) {
            throw new \LogicException(sprintf('Invalid object type. Expected "%s" but got "%s".', $this->objectClass, get_class($object)));
        }

        $hydrator = $this->objectManager->getHydratorFor($this->objectClass);
        $hydrator->load($object);
    }
531656
private function notSuitableFactoryFor($object)
    {
        switch ($this->notFoundBehaviour) {
            case self::NOT_FOUND_RETURNS_NULL:
                return null;

            case self::NOT_FOUND_RETURN_SOURCE:
                return $object;

            case self::NOT_FOUND_THROWS_EXCEPTION:
            default:
                throw new Exception\UnsupportedObjectException(sprintf(
                    'Can\'t create a View from object of type "%s"',
                    is_object($object) ? get_class($object) : gettype($object)
                ));
        }
    }
1264971
public static function reset($object)
	{
		if (!($object instanceof MessageOptions)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\MessageOptions.');
		}
		$object->messageSetWireFormat = NULL;
		$object->noStandardDescriptorAccessor = NULL;
		$object->deprecated = NULL;
		$object->mapEntry = NULL;
		$object->uninterpretedOption = NULL;
	}
1068193
protected function callMethods($object)
    {
        if (! empty($this->methods)) {
            foreach ($this->methods as $method => $args) {
                $reflection = new \ReflectionMethod($object, $method);

                $arguments = array();

                foreach ($args as $arg) {
                    if (is_string($arg) && (class_exists($arg) || $this->container->bound($arg))) {
                        $arguments[] = $this->container->resolve($arg);
                        continue;
                    }

                    $arguments[] = $arg;
                }

                $reflection->invokeArgs($object, $arguments);
            }
        }

        return $object;
    }
933427
public static function reset($object)
	{
		if (!($object instanceof DescriptorProto)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\DescriptorProto.');
		}
		$object->name = NULL;
		$object->field = NULL;
		$object->extension = NULL;
		$object->nestedType = NULL;
		$object->enumType = NULL;
		$object->extensionRange = NULL;
		$object->oneofDecl = NULL;
		$object->options = NULL;
		$object->reservedRange = NULL;
		$object->reservedName = NULL;
	}
1161308
protected function normalizeObject($object, $format, array $context)
    {
        if (!$this->serializer instanceof NormalizerInterface) {
            throw new LogicException(
                'Cannot normalize object because the injected serializer is not a normalizer'
            );
        }

        return $this->serializer->normalize($object, $format, $context);
    }
362946
private function updateObject(Model $object)
    {
        $schema = $this->reposSchema;
        $changes = $object->getModelChanges();
        $schemaColumns = $schema->getColumns();

        $params = [];
        $columns = [];

        $sql = "UPDATE `{$schema->schemaName}`";

        foreach ($changes as $columnName => $value) {

            if ($columnName == $schema->uniqueIdentifierColumnName) {
                continue;
            }

            $changeData = $changes;

            if (isset($schemaColumns[$columnName])) {
                $storageColumns = $schemaColumns[$columnName]->getStorageColumns();

                $transforms = $this->columnTransforms[$columnName];

                if ($transforms[1] !== null) {
                    $closure = $transforms[1];

                    $transformedData = $closure($changes);

                    if (is_array($transformedData)) {
                        $changeData = $transformedData;
                    } else {
                        $changeData[$columnName] = $transformedData;
                    }
                }

                foreach ($storageColumns as $storageColumnName => $storageColumn) {
                    $value = (isset($changeData[$storageColumnName])) ? $changeData[$storageColumnName] : null;

                    $columns[] = "`" . $storageColumnName . "` = :" . $storageColumnName;

                    $params[$storageColumnName] = $value;
                }
            }
        }

        if (sizeof($columns) <= 0) {
            return;
        }

        $sql .= " SET " . implode(", ", $columns);
        $sql .= " WHERE `{$schema->uniqueIdentifierColumnName}` = :{$schema->uniqueIdentifierColumnName}";

        $params[$schema->uniqueIdentifierColumnName] = $object->UniqueIdentifier;

        $statement = $this->executeStatement($sql, $params);

        return $statement->rowCount();
    }
985978
protected function createModelAndSetDependencies(ModelFactoryInterface $modelFactory, $object)
    {
        $models = $this->createModelsAndSetDependencies($modelFactory, [$object]);

        return reset($models);
    }
1192585
protected function resetObject(&$object)
    {
        $class = new \ReflectionClass($this->className);
        $properties = $class->getDefaultProperties();

        foreach ($properties as $propName => $property) {
            if (is_string($property) && class_exists($property)) {
                $object->with(null, $propName);
            }
        }
    }
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;
	}
282729
static function insertIntoPool(Model $object) {
		if (
			!static::$_poolEnabled
			|| static::$_instancePoolCount >= static::MAX_INSTANCE_POOL_SIZE
			|| empty(static::$_primaryKeys)
		) {
			return;
		}

		$pool_key = implode('-', $object->getPrimaryKeyValues());
		if (empty($pool_key)) {
			return;
		}

		if (!isset(static::$_instancePool[$pool_key])) {
			++static::$_instancePoolCount;
		}

		static::$_instancePool[$pool_key] = $object;
	}
406668
public static function reset($object)
	{
		if (!($object instanceof FieldOptions)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\FieldOptions.');
		}
		$object->ctype = NULL;
		$object->packed = NULL;
		$object->jstype = NULL;
		$object->lazy = NULL;
		$object->deprecated = NULL;
		$object->weak = NULL;
		$object->uninterpretedOption = NULL;
	}
649488
public function remove($object) : void
    {
        $hash = spl_object_hash($object);

        unset($this->objects[$hash]);
        unset($this->data[$hash]);
    }
138718
public function add(Database\Model $object)
    {
        if ($this->items === null) {
            if ( ! $this->fillItems()) {
                return false;
            }
        }
        $this->addToDb($object);
        $this->addItem($object);

        return true;
    }
70411
protected function preUpdateManyToManyManager($object)
    {
        $this->configureManyToManyManager();

        $rc = new \ReflectionClass($this->getClass());
        $remove_method = 'remove' . ucfirst($rc->getShortName());

        foreach ($this->manyToManyCollections as $fieldname) {
            $get_method = 'get' . ucfirst($fieldname);
            $orig_collection = $object->$get_method()->getSnapshot();
            $new_collection = $object->$get_method();
            foreach ($orig_collection as $entity) {
                if (!$new_collection->contains($entity)) {
                    $entity->$remove_method($object);
                    $this->getModelManager()->update($entity);
                }
            }
        }
    }
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));
    }