Download the PHP package timefrontiers/php-database-object without Composer

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

TimeFrontiers PHP Database Object

Active Record infrastructure for SQL Database 1.1, with schema-aware writes, prepared fluent queries, explicit connection injection, and ecosystem-standard HasErrors diagnostics.

PHP Version

Requirements

Install the package with Composer:

Model definition

DatabaseObject is a trait and already includes HasErrors:

Models resolve connections in this compatibility order:

  1. The connection supplied through setConnection().
  2. The class connection supplied through useConnection().
  3. Linktude's global $database facade.

Explicit injection is preferred, especially inside transactions:

Hydrated records retain the exact facade that performed the read. A later save() or delete() therefore stays on the caller's transaction-bound connection even if static or global state changes.

Writes and errors

save() inserts when the primary key is empty and updates when it is populated. A preassigned-key insert must use explicit repository SQL because a populated key always routes to update.

SQL Database 1.1 operational failures return false. Database Object checks that result and imports only the connection errors appended by the current operation into _create, _update, or _delete.

The behavior is deliberate:

Exact-one-row updates, optimistic versions, row locks, immutable inserts, and multi-row state transitions belong in repository SQL, not Active Record save().

Fluent queries

The builder binds values and accepts plain identifiers only. Supported general operators are =, !=, <>, <, <=, >, >=, LIKE, NOT LIKE, and <=>. Use whereNull(), whereNotNull(), whereIn(), and whereNotIn() for their dedicated cases.

Empty IN matches nothing; empty NOT IN matches everything. Negative limits and offsets, unsupported operators, raw select expressions, and invalid identifiers throw InvalidArgumentException before execution.

Result contracts are:

Method Success with no match Database failure
get() [] false
first() false false with builder errors
count() 0 false
exists() false false with builder errors

Use strict comparisons: [] !== false and 0 !== false. count(), exists(), and first() do not mutate the builder's select or pagination state.

Reviewed custom SQL

Expression-heavy or otherwise custom developer-authored SQL remains available through findBySql():

The :database:/:db:, :table:/:tbl:, and :primary_key:/:pkey: placeholders are replaced with quoted model identifiers. Values still belong in prepared parameters.

Caller-owned transactions

Database Object never begins, commits, rolls back, closes, changes, or upgrades a connection during persistence, hydration, or schema discovery.

The caller owns the transaction. Returning false from a SQL Database callback does not request rollback, so a model failure must be checked and translated to an exception when rollback is required. Commit failures and uncertain outcomes belong to the repository/application reconciliation policy; this package does not retry them.

External providers, mail, wallets, files, and queues stay outside the database callback. Billing locks, version checks, immutable financial records, and exact affected-row transitions remain explicit repository operations.

Schema caching

Field metadata is cached by the wrapped driver object's identity plus database and table. Identically named tables on different servers or connections do not share metadata, failed discovery is never cached, and explicit primary-key overrides do not alter cached table metadata.

Linktude connection upgrade compatibility

The protected _upgradeConn() helper remains for legacy Linktude models. It requires the global get_constant, get_dbuser, and get_dbserver bootstrap helpers. It returns an existing non-guest connection unchanged and refuses to replace a guest connection during an active managed transaction. Repositories should acquire the required connection before beginning and should not call this helper.

Tests

Integration tests use TF_SQL_TEST_HOST, TF_SQL_TEST_PORT, TF_SQL_TEST_DATABASE, TF_SQL_TEST_USER, and TF_SQL_TEST_PASSWORD. The database name must contain test; the suite creates and removes only uniquely named disposable tables.

See UPGRADING.md before moving a 1.0 consumer to 1.1.

License

MIT License.


All versions of php-database-object with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
timefrontiers/php-core Version ^1.0
timefrontiers/php-has-errors Version ^1.0
timefrontiers/php-sql-database Version ^1.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 timefrontiers/php-database-object contains the following files

Loading the files please wait ...