<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
/**
* @param array $params
*
- * @return $this|null
+ * @return this|null
*/
- static function add(&$params) {
+ public static function add(&$params) {
if (empty($params)) {
return NULL;
}
- $dao = new CRM_Event_DAO_ParticipantStatusType;
+ $dao = new CRM_Event_DAO_ParticipantStatusType();
$dao->copyValues($params);
return $dao->save();
}
/**
* @param array $params
*
- * @return $this|null
+ * @return this|null
*/
- static function &create(&$params) {
+ public static function &create(&$params) {
$transaction = new CRM_Core_Transaction();
$statusType = self::add($params);
if (is_a($statusType, 'CRM_Core_Error')) {
*
* @return bool
*/
- static function deleteParticipantStatusType($id) {
+ public static function deleteParticipantStatusType($id) {
// return early if there are participants with this status
- $participant = new CRM_Event_DAO_Participant;
+ $participant = new CRM_Event_DAO_Participant();
$participant->status_id = $id;
if ($participant->find()) {
return FALSE;
CRM_Utils_Weight::delWeight('CRM_Event_DAO_ParticipantStatusType', $id);
- $dao = new CRM_Event_DAO_ParticipantStatusType;
+ $dao = new CRM_Event_DAO_ParticipantStatusType();
$dao->id = $id;
$dao->find(TRUE);
$dao->delete();
*
* @return CRM_Event_DAO_ParticipantStatusType|null
*/
- static function retrieve(&$params, &$defaults) {
+ public static function retrieve(&$params, &$defaults) {
$result = NULL;
- $dao = new CRM_Event_DAO_ParticipantStatusType;
+ $dao = new CRM_Event_DAO_ParticipantStatusType();
$dao->copyValues($params);
if ($dao->find(TRUE)) {
CRM_Core_DAO::storeValues($dao, $defaults);
*
* @return bool
*/
- static function setIsActive($id, $isActive) {
+ public static function setIsActive($id, $isActive) {
return CRM_Core_DAO::setFieldValue('CRM_Event_BAO_ParticipantStatusType', $id, 'is_active', $isActive);
}
//lets get the transaction mechanism.
$transaction = new CRM_Core_Transaction();
- $ids = array($participantId);
+ $ids = array($participantId);
$expiredId = array_search('Expired', $expiredStatuses);
- $results = CRM_Event_BAO_Participant::transitionParticipants($ids, $expiredId, $values['status_id'], TRUE, TRUE);
+ $results = CRM_Event_BAO_Participant::transitionParticipants($ids, $expiredId, $values['status_id'], TRUE, TRUE);
$transaction->commit();
if (!empty($results)) {
return array('is_error' => 0, 'messages' => $returnMessages);
}
-}
+}