+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
}
/**
- * Split a large array of contactIDs into more manageable smaller chunks
+ * Split a large array of contactIDs into more manageable smaller chunks.
*/
public function &splitContactIDs(&$contactIDs) {
// contactIDs could be a real large array, so we split it up into
}
/**
- * Given a set of contact IDs get the values
+ * Given a set of contact IDs get the values.
*/
public function getValues(&$contactIDs, &$additionalContactIDs) {
*/
public function auxTable($tables) {
foreach ($tables as $tableName => $daoName) {
- $fields = & $this->dbFields($daoName, TRUE);
+ $fields = &$this->dbFields($daoName, TRUE);
$sql = "SELECT * from $tableName";
$this->sql($sql, $tableName, $fields);
FROM civicrm_option_group
WHERE name IN ( $nameString )
";
- $fields = & $this->dbFields('CRM_Core_DAO_OptionGroup', TRUE);
+ $fields = &$this->dbFields('CRM_Core_DAO_OptionGroup', TRUE);
$this->sql($sql, 'civicrm_option_group', $fields);
$sql = "
INNER JOIN civicrm_option_group g ON v.option_group_id = g.id
WHERE g.name IN ( $nameString )
";
- $fields = & $this->dbFields('CRM_Core_DAO_OptionValue', TRUE);
+ $fields = &$this->dbFields('CRM_Core_DAO_OptionValue', TRUE);
$this->sql($sql, 'civicrm_option_value', $fields);
}
* @param $whereField
* @param null $additionalWhereCond
*/
- function table(&$ids,
- $tableName,
- &$fields,
- $whereField,
- $additionalWhereCond = NULL
+ public function table(
+ &$ids,
+ $tableName,
+ &$fields,
+ $whereField,
+ $additionalWhereCond = NULL
) {
if (empty($ids)) {
return;
* @param $fields
*/
public function sql($sql, $tableName, &$fields) {
- $dao = & CRM_Core_DAO::executeQuery($sql);
+ $dao = &CRM_Core_DAO::executeQuery($sql);
while ($dao->fetch()) {
$value = array();
* @param $contactIDs
*/
public function contact(&$contactIDs) {
- $fields = & $this->dbFields('CRM_Contact_DAO_Contact', TRUE);
+ $fields = &$this->dbFields('CRM_Contact_DAO_Contact', TRUE);
$this->table($contactIDs, 'civicrm_contact', $fields, 'id', NULL);
}
* @param $contactIDs
*/
public function note(&$contactIDs) {
- $fields = & $this->dbFields('CRM_Core_DAO_Note', TRUE);
+ $fields = &$this->dbFields('CRM_Core_DAO_Note', TRUE);
$this->table($contactIDs, 'civicrm_note', $fields, 'entity_id', "entity_table = 'civicrm_contact'");
}
* @param $contactIDs
*/
public function phone(&$contactIDs) {
- $fields = & $this->dbFields('CRM_Core_DAO_Phone', TRUE);
+ $fields = &$this->dbFields('CRM_Core_DAO_Phone', TRUE);
$this->table($contactIDs, 'civicrm_phone', $fields, 'contact_id', NULL);
}
* @param $contactIDs
*/
public function email(&$contactIDs) {
- $fields = & $this->dbFields('CRM_Core_DAO_Email', TRUE);
+ $fields = &$this->dbFields('CRM_Core_DAO_Email', TRUE);
$this->table($contactIDs, 'civicrm_email', $fields, 'contact_id', NULL);
}
* @param $contactIDs
*/
public function im(&$contactIDs) {
- $fields = & $this->dbFields('CRM_Core_DAO_IM', TRUE);
+ $fields = &$this->dbFields('CRM_Core_DAO_IM', TRUE);
$this->table($contactIDs, 'civicrm_im', $fields, 'contact_id', NULL);
}
* @param $contactIDs
*/
public function website(&$contactIDs) {
- $fields = & $this->dbFields('CRM_Core_DAO_Website', TRUE);
+ $fields = &$this->dbFields('CRM_Core_DAO_Website', TRUE);
$this->table($contactIDs, 'civicrm_website', $fields, 'contact_id', NULL);
}
* @param $contactIDs
*/
public function address(&$contactIDs) {
- $fields = & $this->dbFields('CRM_Core_DAO_Email', TRUE);
+ $fields = &$this->dbFields('CRM_Core_DAO_Email', TRUE);
$this->table($contactIDs, 'civicrm_address', $fields, 'contact_id', NULL);
}
* @param $contactIDs
*/
public function groupContact(&$contactIDs) {
- $fields = & $this->dbFields('CRM_Contact_DAO_GroupContact', TRUE);
+ $fields = &$this->dbFields('CRM_Contact_DAO_GroupContact', TRUE);
$this->table($contactIDs, 'civicrm_group_contact', $fields, 'contact_id', NULL);
}
- // TODO - support group inheritance
- // Parent child group ids are encoded in a text string
/**
+ * TODO - support group inheritance
+ * Parent child group ids are encoded in a text string
* @param $contactIDs
*/
public function group(&$contactIDs) {
}
}
- $fields = & $this->dbFields('CRM_Contact_DAO_Group', TRUE);
+ $fields = &$this->dbFields('CRM_Contact_DAO_Group', TRUE);
$this->table($groupIDs, 'civicrm_group', $fields, 'id');
$this->savedSearch($groupIDs);
}
- // TODO - support search builder and custom saved searches
/**
+ * TODO - support search builder and custom saved searches
* @param $groupIDs
*/
public function savedSearch(&$groupIDs) {
WHERE g.id IN ( $idString )
";
- $fields = & $this->dbFields('CRM_Contact_DAO_SavedSearch', TRUE);
+ $fields = &$this->dbFields('CRM_Contact_DAO_SavedSearch', TRUE);
$this->sql($sql, 'civicrm_saved_search', $fields);
}
* @param $contactIDs
*/
public function entityTag(&$contactIDs) {
- $fields = & $this->dbFields('CRM_Core_DAO_EntityTag', TRUE);
+ $fields = &$this->dbFields('CRM_Core_DAO_EntityTag', TRUE);
$this->table($contactIDs, 'civicrm_entity_tag', $fields, 'entity_id', "entity_table = 'civicrm_contact'");
}
}
}
- $fields = & $this->dbFields('CRM_Core_DAO_Tag', TRUE);
+ $fields = &$this->dbFields('CRM_Core_DAO_Tag', TRUE);
$this->table($tagIDs, 'civicrm_tag', $fields, 'id');
}
";
$fields = $this->dbFields('CRM_Contact_DAO_Relationship', TRUE);
- $dao = & CRM_Core_DAO::executeQuery($sql);
+ $dao = &CRM_Core_DAO::executeQuery($sql);
while ($dao->fetch()) {
if (isset($_relationshipsHandled[$dao->id])) {
continue;
AND (a.activity_type_id != 3 AND a.activity_type_id != 20)
";
- $fields = & $this->dbFields('CRM_Activity_DAO_Activity', TRUE);
+ $fields = &$this->dbFields('CRM_Activity_DAO_Activity', TRUE);
- $dao = & CRM_Core_DAO::executeQuery($sql);
+ $dao = &CRM_Core_DAO::executeQuery($sql);
while ($dao->fetch()) {
// adding source, target and assignee contacts in additional contacts array
$this->addAdditionalContacts(array($dao->contact_id),
'id' => $dao->acID,
'contact_id' => $dao->contact_id,
'activity_id' => $dao->activity_id,
- 'record_type_id' => $dao->record_type_id
+ 'record_type_id' => $dao->record_type_id,
);
$this->appendValue($dao->acID, 'civicrm_activity_contact', $activityContacts);
if (!isset($_fieldsRetrieved[$daoName])) {
$_fieldsRetrieved[$daoName] = array();
$daoFile = str_replace('_',
- DIRECTORY_SEPARATOR,
- $daoName
- ) . '.php';
- include_once ($daoFile);
+ DIRECTORY_SEPARATOR,
+ $daoName
+ ) . '.php';
+ include_once $daoFile;
- $daoFields = & $daoName::fields();
+ $daoFields = &$daoName::fields();
foreach ($daoFields as $key => & $value) {
$_fieldsRetrieved[$daoName][$value['name']] = array(
* @param $contactIDs
*/
public function export(&$contactIDs) {
- $chunks = & $this->splitContactIDs($contactIDs);
+ $chunks = &$this->splitContactIDs($contactIDs);
$additionalContactIDs = array();
* @param null $lastExportTime
* @param bool $discoverContacts
*/
- function run($fileName,
- $lastExportTime = NULL,
- $discoverContacts = FALSE
+ public function run(
+ $fileName,
+ $lastExportTime = NULL,
+ $discoverContacts = FALSE
) {
$this->_discoverContacts = $discoverContacts;
";
}
-
- $dao = & CRM_Core_DAO::executeQuery($sql);
+ $dao = &CRM_Core_DAO::executeQuery($sql);
$contactIDs = array();
while ($dao->fetch()) {
// print_r( json_decode( $json ) );
}
+
}