Legacy ObjectModel vs Modern Doctrine ORM
Relevant source files
The following files were used as context for generating this wiki page:
PrestaShop manages e-commerce data through a dual-architecture approach, transitioning from the legacy ObjectModel system to a modern Doctrine ORM implementation. The project requires a web server running PHP 8.1+ and MySQL 5.6+ to support these data persistence layers. The legacy system relies on XML-based entity definitions for data seeding and installation, while the modern stack integrates Symfony-based components and automated UI testing libraries.
Sources: README.md:52-54, INSTALL.txt:39-41
Entity Definition and Data Structure
The project defines core data entities through XML configuration files during the installation process. These files specify the schema and initial content for objects like CMS pages, establishing the standard fields required for persistence in the database.
CMS Entity Schema
The cms entity represents content pages within the application. The following fields are defined for this entity:
| Field | Type | Description |
|---|---|---|
id | String/ID | Unique identifier for the CMS page (e.g., "Delivery", "About_us"). |
meta_title | String | The title used for SEO and browser tabs. |
meta_description | String | A brief summary of the page for search engines. |
content | HTML/Text | The primary body content of the page, often containing HTML tags. |
link_rewrite | String | The URL-friendly version of the title for routing. |
Sources: install-dev/langs/en/data/cms.xml:4-35, install-dev/langs/zh/data/cms.xml:4-10
Entity Relationship Visualization
The following diagram illustrates the structure of a standard PrestaShop entity as defined in the installation data files.
The diagram shows the attributes of the CMS entity which are localized across multiple languages including English, Chinese, and others.
Sources: install-dev/langs/en/data/cms.xml:4-9, install-dev/langs/zh/data/cms.xml:4-9
Technical Environment and Requirements
PrestaShop 9.0 and subsequent versions utilize a specific stack to maintain compatibility between legacy data handling and modern requirements.
- PHP Version: Requires PHP 8.1 or higher.
- Database: Supports MySQL 5.6+, MariaDB, or Percona Server.
- Infrastructure: Provides a Docker-based environment for development.
- Testing Stack: Utilizes
mysql2for database interaction in UI tests, alongsidePlaywright,Mocha, andChai.
Sources: README.md:52-56, README.md:73-81, tests/UI/package.json:115-120
System Setup Flow
The following flowchart describes the process of initializing the PrestaShop environment, which involves unzipping core assets and running the installer to populate entities.
The process ensures the database is correctly configured and seeded with the entities defined in the language data files.
Sources: INSTALL.txt:47-59
Testing and Persistence Validation
The modern transition includes a robust testing suite for validating data persistence and user interface behavior. The testing environment utilizes TypeScript and Node.js tools to ensure the integrity of the entities across both legacy and modern modules.
Key Testing Dependencies
| Dependency | Version | Purpose |
|---|---|---|
mysql2 | ^3.24.4 | Low-level MySQL client for data verification. |
playwright | - | Browser automation for UI testing. |
mocha | ^11.8.0 | Test runner for functional and regression campaigns. |
chai | ^6.2.2 | Assertion library for test validation. |
Sources: tests/UI/package.json:113-122
Automated Testing Campaigns
The system executes specific test campaigns to verify different segments of the application, including the Back Office (BO) and Web Services (WS).
// Example test scripts from package.json
"test:functional:BO": "TEST_PATH='functional/BO/**/*' npm run test:specific",
"test:functional:WS": "TEST_PATH='functional/WS/**/*' npm run test:specific",
"test:regression": "TEST_PATH='regression/**/*' npm run test:specific"
Sources: tests/UI/package.json:44-98
Summary
PrestaShop maintains a hybrid data architecture where legacy entities are defined via XML for installation and managed via PHP, while newer components leverage Symfony and Doctrine. This structure is supported by a PHP 8.1+ environment and verified through an extensive automated testing suite targeting functional, regression, and API layers.
Sources: README.md:1-20, INSTALL.txt:39-45, tests/UI/package.json:1-10