PHP Interface Webmozart\Json\Migration\JsonMigration

The JSON object is expected to have the property "version" set.
Since: 1.3
Author: Bernhard Schussek ([email protected])
Show file Open project: webmozart/json Interface Usage Examples

Public Methods

Method Description
down ( stdClass $data ) Reverts a JSON object from the target to the source version.
getSourceVersion ( ) : string Returns the version of the JSON object that this migration expects.
getTargetVersion ( ) : string Returns the version of the JSON object that this migration upgrades to.
up ( stdClass $data ) Upgrades a JSON object from the source to the target version.

Method Details

down() public method

Reverts a JSON object from the target to the source version.
public down ( stdClass $data )
$data stdClass The JSON object of the package file

getSourceVersion() public method

Returns the version of the JSON object that this migration expects.
public getSourceVersion ( ) : string
return string The version string

getTargetVersion() public method

Returns the version of the JSON object that this migration upgrades to.
public getTargetVersion ( ) : string
return string The version string

up() public method

Upgrades a JSON object from the source to the target version.
public up ( stdClass $data )
$data stdClass The JSON object of the package file