ObjectCache::serialize()protectedWC 1.0

Convert an object to a serialized form suitable for caching. If a class overrides this method it should override 'deserialize' as well.

{} It's a method of the class: ObjectCache{}

No Hooks.


Array. The serialized object.


// protected - for code of main (parent) or child class
$result = $this->serialize( $object ): array;
$object(array|object) (required)
The object to serialize.

Code of ObjectCache::serialize() WC 7.1.0

protected function serialize( $object ): array {
	return array( 'data' => $object );