CiviCRM: Difference between revisions
extract upgrade |
use Subpages template |
||
| (One intermediate revision by the same user not shown) | |||
| Line 2: | Line 2: | ||
{{#ev:vimeo|192125770}} | {{#ev:vimeo|192125770}} | ||
{{Subpages|}} | |||
{{ | |||
== Documentation == | == Documentation == | ||
| Line 134: | Line 132: | ||
You can create your own tokens by implementing <code>hook_civicrm_tokens()</code> and <code>hook_civicrm_tokenValues()</code>. See | You can create your own tokens by implementing <code>hook_civicrm_tokens()</code> and <code>hook_civicrm_tokenValues()</code>. See | ||
< | <syntaxhighlight lang="php"> | ||
<?php | <?php | ||
/** | /** | ||
| Line 292: | Line 290: | ||
} | } | ||
} | } | ||
</ | </syntaxhighlight> | ||
* [https://civicrm.stackexchange.com/questions/2558/tokens-for-custom-field-set-with-multiple-records?rq=1 Stack Exchange] | * [https://civicrm.stackexchange.com/questions/2558/tokens-for-custom-field-set-with-multiple-records?rq=1 Stack Exchange] | ||
| Line 347: | Line 345: | ||
== Database == | == Database == | ||
The database code in CiviCRM is divided into two logical sections: the DAO and the BAO. The BAO holds the "business logic" for objects and extends the DAO. The DAO is concerned with data to/from the database backend and it's definition (object to relational database mapping, aka "[[wp:Object-relational mapping|ORM]]"). Both are an extension of the [https://pear.php.net/manual/en/package.database.db-dataobject.php PEAR DB DataObject] class. As of August 2015, this is true and [https://civicrm.org/node/95 this blog post from 2006] gives some more (early) background. | The database code in CiviCRM is divided into two logical sections: the DAO and the BAO. The BAO holds the "business logic" for objects and extends the DAO. The DAO is concerned with data to/from the database backend and it's definition (object to relational database mapping, aka "[[wp:Object-relational mapping|ORM]]"). Both are an extension of the [https://pear.php.net/manual/en/package.database.db-dataobject.php PEAR DB DataObject] class. As of August 2015, this is true and [https://civicrm.org/node/95 this blog post from 2006] gives some more (early) background. | ||
< | <syntaxhighlight lang="php"> | ||
// from CRM/core/DAO.php | // from CRM/core/DAO.php | ||
| Line 353: | Line 351: | ||
require_once 'DB/DataObject.php' | require_once 'DB/DataObject.php' | ||
class CRM_Core_DAO extends DB_DataObject | class CRM_Core_DAO extends DB_DataObject | ||
</ | </syntaxhighlight> | ||
In 2009, [https://civicrm.org/node/597 Doctrine was proposed] as a OODB approach instead of an ORM. There are [https://civicrm.org/blogs/dharmatech/data-mapper-pattern-civicrm-architecture-proposal other discussions too] in the "Architecture Series" that are worth reviewing if you want to know more about database development in CiviCRM. | In 2009, [https://civicrm.org/node/597 Doctrine was proposed] as a OODB approach instead of an ORM. There are [https://civicrm.org/blogs/dharmatech/data-mapper-pattern-civicrm-architecture-proposal other discussions too] in the "Architecture Series" that are worth reviewing if you want to know more about database development in CiviCRM. | ||