Download the PHP package pchec/cakephp-inheritance without Composer

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

Note: This repository is archived and not maintained.

Inheritance plugin for CakePHP

This plugin enables Single Table Inheritance in CakePHP ORM.

Key Features

This plugin allows you to create descendant classes and store their data in one table. One field is used to determine which class the record belongs to. The plugin has two main modes of operation:

Class hierarchy is built as a concatenated string delimitted by | character. It is put into the type field together with the current type name. This allows ancestors to be aware of their descendants and interact with them using the methods and properties they both share. This is an important feature and can have numerous applications.

If you don't need that feature, you can disable it and use only basic mode, where ancestors and descendants don't directly interact with each other but simply share methods and properties. This is achieved by having the type field contain only the current class name.

To illustrate where class hierarchy might be useful, let's look at an example.

Contact is the base class. Client and Supplier are its children. Client has orders, Supplier has deliveries. All Contacts have addresses. A user with permission to see Contact details can potentially view and correct all the addresses, regardless of which descendant class they belong to. However, from the Contact level there is no access to more specific attributes of the children, like orders or deliveries.

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

Usage

In the base table you intend to use, create the type column and make it long, e.g. varchar(255), to give enough room to store more extensivie class hierarchies. By convention, it will be used by the behavior to store the information about the type of the class that the record belongs to. You can use a column with a different name as well, but you will have to define it later in the configuration.

Load the behavior in all the models which are going to use it. Make all the models use the same table name. It is recommend it you name it after the base class.

After you have the base class defined, you can create child classes extending it.

Custom Configuration

You can turn off class hierarchy generation by setting the hierarchy option to false.

You can use your own field name instead of type by passing it in a field_name array key.

You can also use another table for the behavior column instead of the table used by the class, by setting the table option.

By default, the class name YourClassTable receives the type of YourClass. You can customize that by passing the type option.


All versions of cakephp-inheritance with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.16
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 pchec/cakephp-inheritance contains the following files

Loading the files please wait ....