PHPackages                             mnemesong/orm-core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. mnemesong/orm-core

AbandonedLibrary[Database &amp; ORM](/categories/database)

mnemesong/orm-core
==================

Orm core. Contains storages, commands and queries base logic and interfaces.

0.9(3y ago)126MITPHPPHP &gt;=7.4

Since Aug 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mnemesong/orm-core)[ Packagist](https://packagist.org/packages/mnemesong/orm-core)[ RSS](/packages/mnemesong-orm-core/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (10)Versions (12)Used By (0)

mnemesong/orm-core
==================

[](#mnemesongorm-core)

[![Latest Stable Version](https://camo.githubusercontent.com/37bb515782400d1dc26e17c7558880368f53f34e19c364a16c9d1a64d5a0e6dd/687474703a2f2f706f7365722e707567782e6f72672f6d6e656d65736f6e672f6f726d2d636f72652f76)](https://packagist.org/packages/mnemesong/orm-core)[![PHPUnit](https://github.com/mnemesong/orm-core/actions/workflows/phpunit.yml/badge.svg)](https://github.com/mnemesong/orm-core/actions/workflows/phpunit.yml)[![PHPStan-lvl9](https://github.com/mnemesong/orm-core/actions/workflows/phpstan.yml/badge.svg)](https://github.com/mnemesong/orm-core/actions/workflows/phpstan.yml)[![PHP Version Require](https://camo.githubusercontent.com/feaf6a9967dac745f911bc93e2bc27482483e939275f6e25d8398e2e662b7cf0/687474703a2f2f706f7365722e707567782e6f72672f6d6e656d65736f6e672f6f726d2d636f72652f726571756972652f706870)](https://packagist.org/packages/mnemesong/orm-core)[![License](https://camo.githubusercontent.com/f6bfeadb1152105fea73ad2e2e13bf13b98875b2b00fcd44c3cd7e342097b362/687474703a2f2f706f7365722e707567782e6f72672f6d6e656d65736f6e672f6f726d2d636f72652f6c6963656e7365)](https://packagist.org/packages/mnemesong/orm-core)

- The documentation is written in two languages: Russian and English.
- Документация написана на двух языках: русском и английском.

---

General description / Общее описание
------------------------------------

[](#general-description--общее-описание)

### ENG:

[](#eng)

The package provides an implementation of the basic object model for working with storages of various types:

- Class for creating and loading files: RecordsQueue and ScalarsQueue.
- Class for creating and configuring commands: DeleteCommand, SaveCommand, UpdateCommand.
- Interfaces and traits: AbleToRecording, LimitExecutable, AbleToSort have special logic for classes and commands, as well as helper methods for testing their receivers.
- Highly specialized interfaces for storage activities: RecordsDeleteModelInterface, RecordsSaveModelInterface, RecordsSearchModelInterface, RecordsUpdateModelInterface, ScalarsSearchModelInterface.
- Interface for storage: StorageInterface is a way to create all types of files and commands.

### RUS:

[](#rus)

Пакет предоставляет реализации базовую необходимую объектную модель для работы с хранилищами различных типов:

- Классы для создания и настройки запросов: RecordsQueue и ScalarsQueue.
- Классы для создания и настройки комманд: DeleteCommand, SaveCommand, UpdateCommand.
- Интерфейсы и трейты: AbleToRecording, LimitExecutable, AbleToSort содержащие специфичную логику для классов и комманд, а так-же вспомогательные методы для тестирования их приемников.
- Узко-специализированные интерфейсы для активностей хранилищ: RecordsDeleteModelInterface, RecordsSaveModelInterface, RecordsSearchModelInterface, RecordsUpdateModelInterface, ScalarsSearchModelInterface.
- Интерфейс для хранилища: StorageInterface - способный порождать все указанные выше типы запросов и команд.

---

Requirements / Требования
-------------------------

[](#requirements--требования)

- PHP &gt;= 7.4
- Composer &gt;=2.0

---

Installation / Установка
------------------------

[](#installation--установка)

composer require "mnemesong/orm-core"

---

Table manager / Менеджер таблицы
--------------------------------

[](#table-manager--менеджер-таблицы)

### ENG

[](#eng-1)

A table manager is an object that allows you to interact with a table from any storage. The Table Manager provides two ways to interact with a table.

- Queries - Allows you to get records and statistical information in scalar values from a table.
- Commands - Responsible for actions that change the state of the table: adding, deleting and updating records.

In this package, the TableManager is only an interface. TableManager implementations for each concrete type the storages are in separate packages.

### RUS

[](#rus-1)

Менеджер таблицы - это объект, который позволяет взаимодействовать с таблицей из любого хранилища. Менеджер таблицы предоставляет два способа для взаимодействия с таблицей.

- Запросы (Queries) - Позволяют получать из таблицы записи и статистистическую информацию в скалярных величинах.
- Комманды (Commands) - Отвечают за действия изменяющие состояние таблицы: добавление, удаление и обновление записей.

В данном пакете TableManager представлен только интерфейсом. Реализации TableManager для каждого конкретного типа хранилища находятся в отдельных пакетах.

---

Queries / Запросы
-----------------

[](#queries--запросы)

### ENG

[](#eng-2)

This package provides two types of requests:

#### 1. RecordsQuery

[](#1-recordsquery)

Allows you to retrieve records from a table as objects of the Structure class (See mnemesong/structure package).

###### Methods

[](#methods)

- `sortedBy(string[] $fields): self`, `withoutSorting(): self` - Lets get RecordQuery with specified sort fields and their priority.
- `where(SpecificationInterface $spec): self`, `andWhere(SpecificationInterface $spec): self`, `orWhere(SpecificationInterface $spec): self`- Allows you to get a RecordQuery with a specification search.
- `withOnlyFields(string[] $fields): self`, `withAllFields(): self` - Allows you to get RecordQuery indicating which fields to look for when searching.
- `withLimit(int $limit): self`, `withoutLimit(int $limit): self` - Allows you to get RecordQuery specifying the record search limit. Useful when you need to get only the first, or several first entries. Use sorting to operate the criteria for selecting the first records.
- `find(): StructureCollection` - Performs a search and returns the found results as an object StructureCollection.

###### Example

[](#example)

`$checkAuthRecord = $someTable->selectRecordsQuery()->andWhere(Sp::ex('s=', 'login', $inputLogin))->andWhere(Sp::ex('s=', 'passwordHash', HashTool::hash($inputPass)))->withLimit(1)->find()->getFirstAsserted()`#### 2. ScalarsQuery

[](#2-scalarsquery)

Allows you to get scalar data sets for records that meet the specified specification as a Structure object (See package mnemesong/structure).

###### Methods

[](#methods-1)

- `where(SpecificationInterface $spec): self`, `andWhere(SpecificationInterface $spec): self`, `orWhere(SpecificationInterface $spec): self`- Allows you to get a ScalarQuery with a specification search.
- `withAddScalar(ScalarSpecification $spec): self` - Allows you to get a ScalarQuery with a query another scalar lookup value.
- `withScalarsFilteredBy(callable $filterFunc): self` - Allows you to get a ScalarQuery with a new a list of requests for rock values obtained using the filtering function.
- `find(): Structure` - Performs a search and aggregation and returns the found results as an object structure. To configure the keys under which the results will be stored, use the method `ScalarSpecification->withName(string $name)`. Then in from the resulting Structure object the specified scalar value can be obtained using the Structure-&gt;get(string $name): scalar
 method
###### Example

[](#example-1)

`$numOfPotentialCustomers = $someTable->getScalarsQuery()->withAddScalar(Scalar::count()->as('customersCount'))->andWhere(Sp::ex('n>', 'clicksOnBuyButton', 0))->find()->get('customersCount')`---

### RUS

[](#rus-2)

Данный пакет предоставляет два типа запросов:

#### 1. RecordsQuery

[](#1-recordsquery-1)

Позволяет получать из таблицы записи в виде объектов класса Structure (См. пакет mnemesong/structure).

###### Методы

[](#методы)

- `sortedBy(string[] $fields): self`, `withoutSorting(): self` - Позволяют получить RecordQuery с указанными полями для сортировки и их приоритетом.
- `where(SpecificationInterface $spec): self`, `andWhere(SpecificationInterface $spec): self`, `orWhere(SpecificationInterface $spec): self`- Позволяет получить RecordQuery со спецификацией поиска.
- `withOnlyFields(string[] $fields): self`, `withAllFields(): self` - Позволяет получить RecordQuery с указанием какие поля искать при поиске.
- `withLimit(int $limit): self`, `withoutLimit(int $limit): self` - Позволяет получить RecordQuery с указанием лимита поиска записей. Полезно когда надо получить только первую, или несколько первых записей. Для опертирования признаков отбора первых записей используйте сортировку.
- `find(): StructureCollection` - Выполнгяет поиск и выдает найденные результаты в виде объекта StructureCollection.

###### Пример

[](#пример)

`$checkAuthRecord = $someTable->selectRecordsQuery()->andWhere(Sp::ex('s=', 'login', $inputLogin))->andWhere(Sp::ex('s=', 'passwordHash', HashTool::hash($inputPass)))->withLimit(1)->find()->getFirstAsserted()`#### 2. ScalarsQuery

[](#2-scalarsquery-1)

Позволяет получать наборы скалярных данных по записям отвечающим указанной спецификации в виде объекта Structure (См. пакет mnemesong/structure).

###### Методы

[](#методы-1)

- `where(SpecificationInterface $spec): self`, `andWhere(SpecificationInterface $spec): self`, `orWhere(SpecificationInterface $spec): self`- Позволяет получить ScalarQuery со спецификацией поиска.
- `withAddScalar(ScalarSpecification $spec): self` - Позволяет получить ScalarQuery с запросом еще одного скалярного значения поиска.
- `withScalarsFilteredBy(callable $filterFunc): self` - Позволяет получить ScalarQuery с новым списком запросо на скаляные значения, полученным с помощью функции фильтрации.
- `find(): Structure` - Выполняет поиск и аггрегацию и выдает найденные результаты в виде объекта Structure. Для настройки ключей под которыми будут храниться полученные результаты, используйте метод `ScalarSpecification->withName(string $name)`. Тогда в из полученного Structure объекта указанную скалярную величину можно будет получить методом Structure-&gt;get(string $name): scalar

###### Пример

[](#пример-1)

`$numOfPotentialCustomers = $someTable->getScalarsQuery()->withAddScalar(Scalar::count()->as('customersCount'))->andWhere(Sp::ex('n>', 'clicksOnBuyButton', 0))->find()->get('customersCount')`---

Commands / Комманды
-------------------

[](#commands--комманды)

### RUS

[](#rus-3)

Данный пакет предоставляет три типа комманд:

#### 1. SaveCommand

[](#1-savecommand)

Позволяет сохранить запись в хранилище.

---

License / Лицензия
------------------

[](#license--лицензия)

- MIT ---

Contacts / Контакты
-------------------

[](#contacts--контакты)

- Anatoly Starodubtsev "Pantagruel74" - tostar74@mail.ru

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

11

Last Release

1346d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e43a8f700fc734361c2bec28bce54790436b1a10da06dd35a3ccae517709d04?d=identicon)[Pantagruel74](/maintainers/Pantagruel74)

---

Top Contributors

[![mnemesong](https://avatars.githubusercontent.com/u/111166031?v=4)](https://github.com/mnemesong "mnemesong (43 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mnemesong-orm-core/health.svg)

```
[![Health](https://phpackages.com/badges/mnemesong-orm-core/health.svg)](https://phpackages.com/packages/mnemesong-orm-core)
```

###  Alternatives

[theofidry/alice-data-fixtures

Nelmio alice extension to persist the loaded fixtures.

32528.5M70](/packages/theofidry-alice-data-fixtures)[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2592.8M263](/packages/ssch-typo3-rector)[sylius/grid-bundle

Amazing grids with support of filters and custom fields integrated into Symfony.

1358.3M44](/packages/sylius-grid-bundle)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

134391.5k12](/packages/rector-rector-src)[webmozart/key-value-store

A key-value store API with implementations for different backends.

124419.2k11](/packages/webmozart-key-value-store)[setono/doctrine-orm-batcher

A library for processing large collections in Doctrine

28631.7k6](/packages/setono-doctrine-orm-batcher)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
