| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign {
/**
- * Takes an associative array and creates a campaign object
+ * Takes an associative array and creates a campaign object.
*
* the function extract all the params it needs to initialize the create a
* contact object. the params array could contain additional unused name/value
* (reference ) an assoc array of name/value pairs.
*
* @return CRM_Campaign_DAO_Campaign
- * @static
*/
public static function create(&$params) {
if (empty($params)) {
- return;
+ return NULL;
}
if (!(CRM_Utils_Array::value('id', $params))) {
}
/**
- * Delete the campaign
+ * Delete the campaign.
*
* @param int $id
* Id of the campaign.
}
/**
- * Takes a bunch of params that are needed to match certain criteria and
- * retrieves the relevant objects. Typically the valid params are only
- * campaign_id.
+ * Retrieve DB object based on input parameters.
+ *
+ * It also stores all the retrieved values in the default array.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
*
* @return mixed
* $campaigns a set of campaigns.
- * @access public
*/
public static function getCampaigns(
$includeId = NULL,
/**
* Wrapper to self::getCampaigns( )
* w/ permissions and component check.
+ *
+ * @param int $includeId
+ * @param int $excludeId
+ * @param bool $onlyActive
+ * @param bool $onlyCurrent
+ * @param bool $appendDatesToTitle
+ * @param bool $forceAll
+ * @param bool $doCheckForComponent
+ * @param bool $doCheckForPermissions
+ *
+ * @return mixed
*/
public static function getPermissionedCampaigns(
$includeId = NULL,
/**
* Retrieve campaigns for dashboard.
*
- * @static
*/
public static function getCampaignSummary($params = array(), $onlyCount = FALSE) {
$campaigns = array();
/**
* Get the campaign count.
*
- * @static
*/
public static function getCampaignCount() {
return (int) CRM_Core_DAO::singleValueQuery('SELECT COUNT(*) FROM civicrm_campaign');
}
/**
- * Get Campaigns groups
+ * Get Campaigns groups.
*
* @param int $campaignId
* Campaign id.
*
* @return array
- * @static
*/
public static function getCampaignGroups($campaignId) {
static $campaignGroups;
}
/**
- * Update the is_active flag in the db
+ * Update the is_active flag in the db.
*
* @param int $id
* Id of the database record.
* @param bool $is_active
* Value we want to set the is_active field.
*
- * @return Object
+ * @return CRM_Campaign_DAO_Campaign|null
* DAO object on sucess, null otherwise
- * @static
*/
public static function setIsActive($id, $is_active) {
return CRM_Core_DAO::setFieldValue('CRM_Campaign_DAO_Campaign', $id, 'is_active', $is_active);
return $allow;
}
- /*
+ /**
* Add select element for campaign
* and assign needful info to templates.
- */
- /**
+ *
* @param CRM_Core_Form $form
* @param int $connectedCampaignId
*/
}
/**
- * Add campaign in compoent search.
+ * Add campaign in component search.
* and assign needful info to templates.
*
* @param CRM_Core_Form $form
}
$form->assign('campaignInfo', $campaignInfo);
}
+
}