Download the PHP package charcoal/object without Composer

On this page you can find all versions of the php package charcoal/object. 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 object

Charcoal Object

The Object package provides abstract objects, behaviours, and tools for building user-facing Web sites.

Installation

Overview

The package provides a bunch of basic classes, helpers as well as object behaviors (interfaces + traits).

Basic classes

All charcoal project object classes should extend one of the 2 base classes, \Charcoal\Object\UserData, for data created from clients / users.

Content

The Content base class should be used for all objects which can be "managed". Typically by an administrator, via the charcoal/admin package. It adds the "active" flag to objects as well as creation and modification informations.

API

The Content class extends \Charcoal\Model\AbstractModel from the charcoal/core module, which means that it also inherits its API as well as the DescribableInterface (metadata(), setMetadata() and loadMetadata(), amongst others) and the StorableInterface (id(), key(), save(), update(), delete(), load(), loadFrom(), loadFromQuery(), source() and setSource(), amongst others).

The AbstractModel class extends \Charcoal\Config\AbstractEntity which also defines basic data-access methods (setData(), data(), keys(), has(), get(), set(), plus the ArrayAccess, JsonSerializable and Serializable interfaces).

Properties (metadata)

Property Type Default Description
active boolean true
position number null
created date-time null [1]
created_by string '' [1]
last_modified date-time null [2]
last_modified_by string '' [2]

[1] Auto-generated upon save()
[2] Auto-generated upon update()

Default metadata is defined in metadata/charcoal/object/content.json

UserData

The UserData class should be used for all objects that are expected to be entered from the project's "client" or "end user".

API

The Content class extends \Charcoal\Model\AbstractModel from the charcoal/core module, which means that it also inherits its API as well as the DescribableInterface (metadata(), setMetadata() and loadMetadata(), amongst others) and the StorableInterface (id(), key(), save(), update(), delete(), load(), loadFrom(), loadFromQuery(), source() and setSource(), amongst others).

The AbstractModel class extends \Charcoal\Config\AbstractEntity which also defines basic data-access methods (setData(), data(), keys(), has(), get(), set(), plus the ArrayAccess, JsonSerializable and Serializable interfaces).

Properties (metadata)

Property Type Default Description
ip ip null [1]
ts date-time null [1]
lang lang null [1]

[1] Auto-generated upon save() and update()

Default metadata is defined in metadata/charcoal/object/user-data.json

Object behaviors

Archivable

The archivable behavior is not yet documented. It is still under heavy development.

Categorizable

API

Properties (metadata)

Property Type Default Description
category object null The object's category.[1]

[1] The category obj_type must be explicitely set in implementation's metadata.

Default metadata is defined in metadata/charcoal/object/catgorizable-interface.json

Category

API

Properties (metadata)

Property Type Default Description
category_item string null

Default metadata is defined in metadata/charcoal/object/catgory-interface.json

Hierarchical

API

Properties (metadata)

Property Type Default Description
master object null The master object (parent in hierarchy).

Default metadata is defined in metadata/charcoal/object/hierarchical-interface.json.

Publishable

Properties (metadata)

Property Type Default Description
publishDate date-time null
expiryDate date-time null
publishStatus string [1] 'draft'

Default metadata is defined in metadata/charcoal/object/publishable-interface.json.

Revisionable

Revisionable objects implement \Charcoal\Object\Revision\RevisionableInterface, which can be easily implemented by using \Charcoal\Object\Revision\RevisionableTrait.

Revisionable objects create revisions which logs the changes between an object's versions, as diffs.

API

Properties (metadata)

The revisionable behavior does not implement any properties as all logic & data is self-contained in the revisions.

Routable

The routable behavior is not yet documented. It is still under heavy development.

Helpers

ObjectDraft

ObjectRevision

Upon every update in storage, a revisionable object creates a new revision (a \Charcoal\Object\ObjectRevision instance) which holds logs the changes (diff) between versions of an object:

Revision properties

Property Type Default Description
target_type string null The object type of the target object.
target_id string null The object idenfiier of the target object.
rev_num integer null Revision number, (auto-generated).
ref_ts date-time
rev_user string null
data_prev structure
data_obj structure
data_diff structure

Revision methods

ObjetSchedule

It is possible, (typically from the charcoal admin backend), to create schedule (a \Charcaol\Object\ObjectSchedule instance) which associate a set of changes to be applied automatically to an object:

Schedule properties

Property Type Default Description
target_type string null The object type of the target object.
target_id string null The object idenfiier of the target object.
scheduled_date date-time null
data_diff structure []
processed boolean false
processed_date

Schedule methods (API)

Scheduled actions should be run with a timely cron job. The charcoal/admin module contains a script to run schedules automatically:

Resources


All versions of object with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
psr/log Version ^1.0
charcoal/config Version ^5.0
charcoal/core Version ^5.0
charcoal/factory Version ^5.0
charcoal/translator Version ^5.0
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 charcoal/object contains the following files

Loading the files please wait ....