src/Model.php
public function get_data_to_cache() {

		$data = $this->get_raw_attributes();

		$columns = static::table()->get_columns();

		foreach ( $data as $column => $value ) {
			if ( isset( $columns[ $column ] ) ) {
				$data[ $column ] = $columns[ $column ]->prepare_for_storage( $value );
			}
		}

		return $data;
	}
public function get_data_to_cache() {

		$data = $this->get_raw_attributes();

		$columns = static::table()->get_columns();

		foreach ( $data as $column => $value ) {
			if ( isset( $columns[ $column ] ) ) {
				$data[ $column ] = $columns[ $column ]->prepare_for_storage( $value );
			}
		}

		return $data;
	}
Get the data we'd like to cache.

This is a bit magical. It iterates through all of the table columns,
and checks if a getter for that method exists. If so, it pulls in that
value. Otherwise, it will pull in the default value. If you'd like to
customize this you should override this function in your child model
class.

@since 1.0

@return array