Download the PHP package xwoo/data-type without Composer
On this page you can find all versions of the php package xwoo/data-type. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xwoo/data-type
More information about xwoo/data-type
Files in xwoo/data-type
Package data-type
Short Description A library for working and standardizing working with WooCommerce data types.
License GPL-3.0-or-later
Homepage https://extended.woo.rs
Informations about the package data-type
WC Data Type
Model-driven custom data objects for WooCommerce
[](https://packagist.org/packages/x-wp/wc-data-type)



[](https://github.com/x-wp/wc-data-type/actions/workflows/tests.yml)
This library provides a standardized way to define and work with custom WooCommerce-style data objects. Define a model once, then reuse consistent property handling, factories, queries, and data-store behavior around it.
Key Features
- Model-driven setup: Define object shape with the
#[Model]attribute. - WooCommerce-style objects: Extend
XWC_Dataand keep a familiar CRUD workflow. - Typed properties: Support for core props, meta props, and taxonomy props.
- Shared object helpers: Load single objects or collections through package utilities.
- Extensible architecture: Swap in custom data stores, factories, and meta stores when needed.
- WordPress-native integration: Designed for plugin code already built around WordPress and WooCommerce lifecycles.
Installation
You can install this package via Composer:
[!TIP] We recommend using
automattic/jetpack-autoloaderwith this package to reduce autoloading conflicts in WordPress environments.
Usage
Below is a simple example that defines a custom data object and loads it through the package helpers.
Defining a model
Loading objects
Generated getters and setters follow the declared props, so classes like Book can expose methods such as get_title(), set_title(), get_slug(), and set_price().
Testing
The package ships with a PHPUnit suite that boots a WordPress test environment and exercises model definitions, object factories, queries, props, and runtime object behavior.
Run the suite with:
To prepare the local WordPress test environment first:
To clean the local test environment:
Documentation
For package-specific usage, start with the public entrypoints used throughout the library:
XWC\Data\Decorators\ModelXWC_Dataxwc_get_object()xwc_get_objects()
Additional project information is available in the repository.
For maintainers preparing prereleases or stable tags, see docs/release-process.md.
All versions of data-type with dependencies
symfony/polyfill-php81 Version ^1.30
x-wp/helper-classes Version ^1
x-wp/helper-functions Version ^1
x-wp/di-implementation Version ^1
symfony/polyfill-php83 Version ^1.32