lithium\data\Collection::serialize()

public method

Prepares, enables and executes serialization of the object.

Note: because of the limitations outlined below custom handlers are ignored with serialized objects.

Pulls all results to entirely populate _data and closes the object freeing the associated result resource. This allows for skipping the _result property which may hold unserializable PDOStatements.

Properties that hold anonymous functions are also skipped. Some of these can almost be reconstructed (_handlers) others cannot (_methodFilters).

Returns

string

Serialized properties of the object.

Source

	public function serialize() {
		$this->offsetGet(null);
		static::__destruct();

		$vars = get_object_vars($this);
		unset($vars['_result']);
		unset($vars['_handlers']);
		unset($vars['_methodFilters']);

		return serialize($vars);
	}