ATK Demo Walkthrough – Lesson 2

From Achievo/ATK Wiki

Jump to: navigation, search

Contents

Intro

Business applications usually deal with more than one kind of data at a time. For example, an employee may belong to a department. They may also have manager. In this lesson we add a department node to our application. We also modify the employees node we built in lesson 1 to add department and manager information for an employee.

The Departments Node

The file class.department.inc contains the definition of a department. The code in there should look familiar if you followed lesson 1. A new feature introduced in this node is the use of a one-to-many relation: a department can have many employees. Examine the code and play with the demo to see how this is done.

The Employees Node

The file class.employee.inc contains the definition of a node. Most of the code is identical to the employee node file from lesson1, except that now two relations are introduced: a many-to-one relation between employees and their department, as well as a many-to-one relation between an employee and his or her manager. Notice that this second relation is recursive: a manager is also an employee.

The Module

The file module.inc contains the definition of the lesson2 module, and in particular the menu for this lesson. The menu is identical to the previous lesson, with the addition of a menu entry for the Departments node.

Personal tools
Navigation