New CakePHP Project
This tutorial shows how simple it is to start a new project using Skipper. We are going to create a CakePHP project with two plugins and four entities. Part of this tutorial is also export of the finished project to CakePHP .php definition files.
Hint: See the ORM Model basics for detailed description of the ORM elements (e.g. plugin, entity).
First step is to create new project with CakePHP framework support. Simply select the New ORM Project from File menu and perform the following steps shown in the pictures.
Application model design
Now we’re going to design a simple application with two plugins and four entities. The first plugin will serve as the contact records, the second plugin as the ecommerce logic. Contact plugin keeps data about the customers and their addresses, ecommerce plugin keeps data about orders and their items. Ecommerce order also has a relation with contact to store the order owner. You can do it this way:
Now when you have created the application model, next step is to export it to CakePHP schema definition files. Before Skipper generates all the files for you, it is necessary to configure schema files destinations and export formats.
Skipper exports single schema file for each CakePHP entity, and it will create schema file for derived class if such file is not already present in the target directory. This means that our sample project will export four to eight schema definition files. Each plugin can have its own export path and format which is relative to project root directory and its own export format. For CakePHP ORM it is PHP definition files.
And here is an example of BaseOrder and Order entity generated by Skipper. As you can see everything is well formatted and exported:
and Order class:
This short tutorial shows that to create new project and export it to schema definition files takes no more than five minutes in Skipper (if it is your first try, it may take little longer). Compare it with manual writing of such small project, and the acceleration of work is breathtaking. And in addition, you can concentrate only on the creative part of your work.