These base classes provide standard CRUD (create, retrieve, update and delete)
methods, etc. <!--fixme why the etc? what else?? -->
The DAO files live in the relevant DAO folder - e.g. CiviCRM/Pledge/DAO and
there is one file for each of the xml files we looked at earlier. These files
are built on the fly when CiviCRM is packaged from the XML files which is why
you won't see them if you checkout CiviCRM from SVN.
The generated DAO object has:
The DAO object generated has:
* A property for each field using the actual field name, not the unique name
* A links function which retrieves the links to other tables (off the foreign keys)
* An import function and an export function for ?
* A fields function which returns an array of fields for that object keyed by the field's unique name. Looking again at the field 'pledge.amount' we see
* A `links()` method which retrieves the links to other tables (off the foreign keys)
* An `import()` method and an `export()` method for ?
* A `fields()` method which returns an array of fields for that object keyed by the field's unique name. Looking at the field 'pledge.amount' we see
* A couple of functions to define the labels for enumerated fields
```php
...
...
@@ -87,11 +91,11 @@ The DAO object generated has:
),
```
Note that the key is the unique name but the name field is the field's name and the 'where' field shows the mysql description of it. We also see the data type and whether it is available for search or export.
The key is the unique name but the name field is the field's name and the 'where' field shows the MySQL description of it. We also see the data type and whether it is available for search or export.
Note that most fields should probably be exportable unless there is a security reason or they are weird & confusing as the search builder is also driven by this setting.
Generally fields should be exportable unless there is a security reason or they are weird and confusing as the search builder is also driven by this setting.
Fields whose option values can be calculated will also have a 'pseudoconstant' section.
Fields whose option values can be calculated will also have a `pseudoconstant` section.
### BAO
BAO stands for business access object
...
...
@@ -109,9 +113,6 @@ pledge is created.
The APIs call 'Create' which then calls 'Add' as well as other associated
functions.
### Form
In general each form page in CiviCRM maps to a file in one of
the form directories. Form files contain a class that extends CRM_Core_Form.
...
...
@@ -155,7 +156,7 @@ and Page classes.
Customising templates is discussed in more detail in 'Techniques'
## The API
The application programming interface (API) is stored in the api root
The application programming interface (API) is stored in the `/api`
directory. Best practice for using the API is discussed in more detail in
'Techniques'
...
...
@@ -168,7 +169,7 @@ or occasional basis, e.g. update geo-coding.
## SQL
The SQL directory is automatically generated as part of a release. It contains
useful files like the SQL to create the database and insert demo data. Most
developers won't need to edit files in this directory.
developers will not need to edit files in this directory.
## l10n
This directory contains lots of automatically generated localisation files.
...
...
@@ -183,31 +184,49 @@ CiviCRM makes use of a lot of 3rd party packages for things like the database,
## Database structure
The database structure is defined in a series of XML files