Download the PHP package cakephp/orm without Composer

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

Total Downloads

CakePHP ORM

The CakePHP ORM provides a powerful and flexible way to work with relational databases. Using a datamapper pattern the ORM allows you to manipulate data as entities allowing you to create expressive domain layers in your applications.

Database engines supported

The CakePHP ORM is compatible with:

Connecting to the Database

The first thing you need to do when using this library is register a connection object. Before performing any operations with the connection, you need to specify a driver to use:

Once a 'default' connection is registered, it will be used by all the Table mappers if no explicit connection is defined.

Using Table Locator

In order to access table instances you need to use a Table Locator.

You can also use a trait for easy access to the locator instance:

By default, classes using LocatorAwareTrait will share a global locator instance. You can inject your own locator instance into the object:

Creating Associations

In your table classes you can define the relations between your tables. CakePHP's ORM supports 4 association types out of the box:

You define associations in your table's initialize() method. See the documentation for complete examples.

Reading Data

Once you've defined some table classes you can read existing data in your tables:

You can use the query builder to create complex queries, and a variety of methods to access your data.

Saving Data

Table objects provide ways to convert request data into entities, and then persist those entities to the database:

The above shows how you can easily marshal and save an entity and its associations in a simple & powerful way. Consult the ORM documentation for more in-depth examples.

Deleting Data

Once you have a reference to an entity, you can use it to delete data:

Meta Data Cache

It is recommended to enable metadata cache for production systems to avoid performance issues. For e.g. file system strategy your bootstrap file could look like this:

Cache configs are optional, so you must require cachephp/cache to add one.

Creating Custom Table and Entity Classes

By default, the Cake ORM uses the \Cake\ORM\Table and \Cake\ORM\Entity classes to interact with the database. While using the default classes makes sense for quick scripts and small applications, you will often want to use your own classes for adding your custom logic.

When using the ORM as a standalone package, you are free to choose where to store these classes. For example, you could use the Data folder for this:

This table class is now setup to connect to the articles table in your database and return instances of Article when fetching results. In order to get an instance of this class, as shown before, you can use the TableLocator:

Using Conventions-Based Loading

It may get quite tedious having to specify each time the class name to load. So the Cake ORM can do most of the work for you if you give it some configuration.

The convention is to have all ORM related classes inside the src/Model folder, that is the Model sub-namespace for your app. So you will usually have the src/Model/Table and src/Model/Entity folders in your project. But first, we need to inform Cake of the namespace your application lives in:

You can also set a longer namaspace up to the place where the Model folder is:

Additional Documentation

Consult the CakePHP ORM documentation for more in-depth documentation.


All versions of orm with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
cakephp/collection Version ^5.1
cakephp/core Version ^5.1
cakephp/datasource Version ^5.1
cakephp/database Version ^5.1
cakephp/event Version ^5.1
cakephp/utility Version ^5.1
cakephp/validation Version ^5.1
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 cakephp/orm contains the following files

Loading the files please wait ....