Skip to content

Getting Started

This content is for v1.0. Switch to the latest version for up-to-date documentation.

Install Articulate, configure database access, and wire the two services used by the rest of the examples.

Terminal window
composer require articulate-orm/core

Configure database access through environment variables:

.env
DATABASE_DSN=mysql:host=mysql;dbname=articulate_test;charset=utf8mb4
DATABASE_USER=user
DATABASE_PASSWORD=userpassword

Register the core Articulate services in your container:

  • Articulate\Connection receives the DSN, username, and password.
  • Articulate\Modules\EntityManager\EntityManager receives the Connection.

Most examples use EntityManager directly to persist, find, query, remove, and flush entities.

  1. Start your database services (Docker Compose or otherwise).
  2. Initialize the migration tracking table.
  3. Apply pending migrations.
  4. Run your first command against real data.
Terminal window
docker compose up -d
docker compose exec php bin/console articulate:init
docker compose exec php bin/console articulate:migrate
docker compose exec php bin/console app:catalog:crud

Continue to Entity Mapping to map your first PHP classes to database tables, or read Context-Bounded Entities to understand what makes Articulate different.