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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package data-type

WC Data Type

Model-driven custom data objects for WooCommerce

[![Packagist Version](https://img.shields.io/packagist/v/x-wp/wc-data-type?label=Release&style=flat-square)](https://packagist.org/packages/x-wp/wc-data-type) ![Packagist PHP Version](https://img.shields.io/packagist/dependency-v/x-wp/wc-data-type/php?label=PHP&logo=php&logoColor=white&logoSize=auto&style=flat-square) ![Static Badge](https://img.shields.io/badge/WP-%3E%3D6.9.4-3858e9?style=flat-square&logo=wordpress&logoSize=auto) ![Static Badge](https://img.shields.io/badge/WC-%3E%3D10.6.1-7f54b3?style=flat-square&logo=woocommerce&logoSize=auto) [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/x-wp/wc-data-type/tests.yml?label=Tests&event=push&style=flat-square&logo=githubactions&logoColor=white&logoSize=auto)](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

  1. Model-driven setup: Define object shape with the #[Model] attribute.
  2. WooCommerce-style objects: Extend XWC_Data and keep a familiar CRUD workflow.
  3. Typed properties: Support for core props, meta props, and taxonomy props.
  4. Shared object helpers: Load single objects or collections through package utilities.
  5. Extensible architecture: Swap in custom data stores, factories, and meta stores when needed.
  6. 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-autoloader with 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:

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

PHP Build Version
Package Version
Requires php Version >=8.0
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
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package xwoo/data-type contains the following files

Loading the files please wait ...