Download the PHP package doomy/ormtopus without Composer

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

Ormtopus

simple ORM library working with Nette framework with entity caching for better performance.

Prerequisities

In order for orm to work, working dibi connection needs to be established first. In your local configuration file (local.neon), you should have your connection set up in similar fashion as below:

Then, in your global config file (common.neon/ config.neon) set up following services:

Entity models

for each entity you plan to be working with equivalent php entity model class has to be created manually. See the example below:

starting from version 3.0.0 there's no need to specify the columns or column properties in uppercase.

Usage

The orm is used by injecting DataEntityManager service into your presenters or wherever needed, see the example:

Data retrieval methods

findById(string $entityClass, int $entityId)

finds a single entity by its id.

findOne(string $entityClass, array|string $where = [])

finds and returns first entity meeting the criteria in $where. Notes on how to compose $where array below.

findAll(string $entityClass, array|string $where = [])

finds and returns array of all entities (if where is specified then all entities that meet the criteria) of given class. Notes on how to compose $where array below.

Data manipulation methods

[DEPRECATED]

create(string $entityClass, array $values)

creates an instance of given entity class from associative array of values in method argument.

example: $clientEntity = $this->data->create(Client::class, ['name' => 'Microsoft', 'ADDRESS' => 'Tasmania']);

NOTE: the preferred way to create a new entity (since version 3.0.0) is now using it's constructor:

This does not save the entity to the database

deleteById(string $entityClass, int $id)

deletes entity in database by id provided

delete(string $entityClass, array|string $where)

deletes all entities meeting provided criteria in database. Notes on how to compose $where array below.

Composing the where criteria

There are basically two criteria assembly styles.

$where as a simple string value

You can either use the whole condition, you would otherwise use in SQL statement as a single string:

$client = $this->data->findOne(Client::class, 'id > 15 AND address = 'New York')

$where as an associative array

The criteria can also be specified as an associative array. See example:

in general usage, multiple criteria will be considered to be joined by AND clause. The associative example is therefore equivalent to the simple string criteria in the former example.

LIKE expressition in assocative $where

$client = $this->data->findOne(Client::class, ['name' => '~Micros']);

will have the same result as:

$client = $this->data->findOne(Client::class, "name LIKE '%Mircros%'");

More complex LIKE criteria can be achieved using the single string $where criteria.

set criteria in assocative $where

$clients = $this->data->findAll(Client::class, ['id' => [1, 2, 3]]);

equals to:

$clients = $this->data->findAll(Client::class, "WHERE id IN(1, 2, 3)");


All versions of ormtopus with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
dibi/dibi Version *
doomy/entitycache Version >= 1.0.0
doomy/repository Version ^8.4
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 doomy/ormtopus contains the following files

Loading the files please wait ....