J4.x

J4.x:Joomla Entities

From Joomla! Documentation

Revision as of 13:03, 12 August 2018 by Isac (talk | contribs) (Installation)
GSoC 2018
Joomla Entities
Documentation
Joomla! 
4.x

Introduction

The scope of this year project is to build and integrate a new Model system into Joomla 4, that will solve some of the current issues from the Webservices project, as well as improve the limits of the current system. The integration will be fully implemented by the release of Joomla 4.0 in the com_content component. The purpose for this documentation is to outline how to use the underlaying Entities project, which can be then used by developers to write new extensions and convert existing ones.

Entities! The entities project is the base project. Without it we would not be able to accomplish the tasks in the Webservices project. Starting as a new project, I have managed to get a basic implementation going of an Active Record pattern based layer that shall be used as a dependency in Joomla CMS, to implement each table as a DAO.

The need for this project comes from the limitations of the current Model architecture which have been reached during the last year GSoC Webservices project.

Because by reaching these limitations, it was clear that the Model layer had to be redone. Taking it a step further, with the desire to make development in Joomla easier, the Entities project was born. The main highlights of this approach is that we can now have relations in our models, feature that has been long missed in Joomla models. Up to now, the One to One and One To Many relations have been implemented.

The project fits perfectly in the Joomla ecosystem, as it is using the joomla-framework/database DatabaseDriver for the connection to various database systems. We have decided that the next step would be actually integrating the Entities project in Joomla CMS, in the lib_api branch of the last year webservices project. Taking a step back from implementing features in a separate project, and actually connecting the dots with the CMS implementation will give us important insights about the features that will be needed in the future.

Installation

The entities project can be easily integrated into any php project by adding the following dependency to your composer file:

"config": {
    "preferred-install": {
        "joomla/event": "dist"
    },
    "require": {
        "joomla/entities": "dev-master"
    }
}

Usage