[CiviCRM] Getting started with CiviCRM

| | 2 min read

FSF-CiviCRM is a popular Customer Relationship Management (CRM) system. The first step in getting started is understanding the CiviCRM codebase. For better understanding, please download CiviCRM zip file from https://civicrm.org/download and install.

Object Oriented Programming

CiviCRM core is built using OOP singleton concept. Singleton framework is one which initiates one class object only once and reuses it afterwards.

Business logic

CiviCRM business logic is handled in directory 'CRM/' in the root of CiviCRM installation. In this directory, you can see core functionalities such as Groups, Contacts, Profiles etc. Each of them inturn has directories named DAO, BAO, Form, Page etc.

DAO

DAO stands for Data Access Object, which acts as wrapper layer around database. It is recommended to use DAO to interact/manage database data.

BAO

BAO is abbreviation of Business Access Object. Actually, BAO is used to extend the DAO for handling business logic.

Form

Form in CiviCRM is implemented as a class extending CRM_Core_Form, which is done using the following methods: preProcess - retrieve data before processing form, buildForm - generate html form using QuickBuildForm helper functions, formRule - form validation rules and postProcess - form subit handler. Also, there will be separate template for each form, which can be found in 'templates/Form/' directory.

Page

If the screen isn't Form, it will be Page. Page is also class similar to Form extended from CRM_Core_Page. The methods available for Page preProcess, run - which displays the page content. Template for the page can be found in the directory 'templates/Page/'.

xml

xml directory contains menu structure of urls mapping to CRM form or page classes and controls access to these URLs using permissions.

Templates

Directory which contains templates of Form, Page etc.

Go through the CiviCRM core for better understanding. Also, before starting work on CiviCRM, please post your plan of work to civicrm forum OR consult other developers instantly on CiviCRM IRC