Merge pull request #4917 from eileenmcnaughton/minor-tidies
[civicrm-core.git] / CRM / Event / BAO / Event.php
index bfe9342ac265ee968553013cee7f70bd6a616eef..64ebe160c7c6bd850ac0d04884cf733aaa3f3a96 100644 (file)
@@ -49,8 +49,7 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
    * @param array $defaults
    *   (reference ) an assoc array to hold the flattened values.
    *
-   * @return CRM_Event_BAO_ManageEvent object
-   * @static
+   * @return CRM_Event_BAO_ManageEvent
    */
   public static function retrieve(&$params, &$defaults) {
     $event = new CRM_Event_DAO_Event();
@@ -70,8 +69,8 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
    * @param bool $is_active
    *   Value we want to set the is_active field.
    *
-   * @return Object             DAO object on sucess, null otherwise
-   * @static
+   * @return Object
+   *   DAO object on sucess, null otherwise
    */
   public static function setIsActive($id, $is_active) {
     return CRM_Core_DAO::setFieldValue('CRM_Event_DAO_Event', $id, 'is_active', $is_active);
@@ -83,7 +82,6 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
    * @param array $params
    *   Reference array contains the values submitted by the form.
    *
-   * @static
    *
    * @return object
    */
@@ -124,8 +122,6 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
    *   Reference array contains the values submitted by the form.
    *
    * @return object
-   * @static
-   *
    */
   public static function create(&$params) {
     $transaction = new CRM_Core_Transaction();
@@ -183,8 +179,6 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
    *   Event id.
    *
    * @return mixed|null
-   * @static
-   *
    */
   public static function del($id) {
     if (!$id) {
@@ -236,7 +230,6 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
    * @param int $eventId
    *   Event with which loc block is associated.
    *
-   * @static
    */
   public static function deleteEventLocBlock($locBlockId, $eventId = NULL) {
     $query = "SELECT count(ce.id) FROM civicrm_event ce WHERE ce.loc_block_id = $locBlockId";
@@ -266,13 +259,12 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
    *   true if you need to check permission else false.
    *
    * @return array
-   * @static
    */
   static function getEvents(
     $all = 0,
-                            $id = FALSE,
-                            $isActive = TRUE,
-                            $checkPermission = TRUE
+    $id = FALSE,
+    $isActive = TRUE,
+    $checkPermission = TRUE
   ) {
     $query = "
 SELECT `id`, `title`, `start_date`
@@ -321,9 +313,9 @@ WHERE  ( civicrm_event.is_template IS NULL OR civicrm_event.is_template = 0 )";
   /**
    * Get events Summary
    *
-   * @static
    *
-   * @return array Array of event summary values
+   * @return array
+   *   Array of event summary values
    */
   public static function getEventSummary() {
     $eventSummary = $eventIds = array();
@@ -597,14 +589,15 @@ $event_summary_limit
    *   Consider counted( is filter role) participant.
    *
    *
-   * @return array array with count of participants for each event based on status/role
+   * @return array
+   *   array with count of participants for each event based on status/role
    */
   public static function getParticipantCount(
     $eventId,
-                                             $considerStatus = TRUE,
-                                             $status = TRUE,
-                                             $considerRole = TRUE,
-                                             $role = TRUE
+    $considerStatus = TRUE,
+    $status = TRUE,
+    $considerRole = TRUE,
+    $role = TRUE
   ) {
 
     // consider both role and status for counted participants, CRM-4924.
@@ -654,8 +647,8 @@ $event_summary_limit
    * @param int $id
    *   For which we want map info.
    *
-   * @return null|string     title of the event
-   * @static
+   * @return null|string
+   *   title of the event
    */
   public static function &getMapInfo(&$id) {
 
@@ -701,9 +694,9 @@ WHERE civicrm_address.geo_code_1 IS NOT NULL
       $params = array('entity_id' => $id, 'entity_table' => 'civicrm_event');
       $addressValues = CRM_Core_BAO_Location::getValues($params, TRUE);
       $location['address'] = str_replace(array(
-          "\r",
-          "\n",
-        ), '', addslashes(nl2br($addressValues['address'][1]['display_text'])));
+        "\r",
+        "\n",
+      ), '', addslashes(nl2br($addressValues['address'][1]['display_text'])));
 
       $location['url'] = CRM_Utils_System::url('civicrm/event/register', 'reset=1&id=' . $dao->event_id);
       $location['location_type'] = $dao->location_type;
@@ -729,8 +722,8 @@ WHERE civicrm_address.geo_code_1 IS NOT NULL
    * @param bool $onlyPublicInclude public events only, default TRUE.
    *   Include public events only, default TRUE.
    *
-   * @return array  $all      array of all the events that are searched
-   * @static
+   * @return array
+   *   array of all the events that are searched
    */
   static function &getCompleteInfo(
     $start = NULL,
@@ -912,16 +905,15 @@ WHERE civicrm_event.is_active = 1
    *
    * @param int $id
    *   The event id to copy.
-   *        obj     $newEvent    object of CRM_Event_DAO_Event
    *        boolean $afterCreate call to copy after the create function
    * @param null $newEvent
    * @param bool $afterCreate
    *
-   * @return void
+   * @return CRM_Event_DAO_Event
    */
   public static function copy($id, $newEvent = NULL, $afterCreate = FALSE) {
 
-    $defaults = $eventValues = array();
+    $eventValues = array();
 
     //get the require event values.
     $eventParams = array('id' => $id);
@@ -1453,7 +1445,6 @@ WHERE civicrm_event.is_active = 1
    * @param array $profileFields
    *
    * @return void
-   * @static
    */
   public static function displayProfile(&$params, $gid, &$groupTitle, &$values, &$profileFields = array()) {
     if ($gid) {
@@ -1730,7 +1721,8 @@ WHERE  id = $cfID
    *
    * @param bool $skipCancel
    *
-   * @return array $customProfile array of Additional participant's info OR array of Ids.
+   * @return array
+   *   array of Additional participant's info OR array of Ids.
    */
   static function buildCustomProfile(
     $participantId,
@@ -1843,7 +1835,8 @@ WHERE  id = $cfID
 
   /* Function to retrieve all events those having location block set.
    *
-   * @return array $events array of all events.
+   * @return array
+   *   array of all events.
    */
   /**
    * @return array
@@ -1932,7 +1925,8 @@ WHERE  ce.loc_block_id = $locBlockId";
    *
    * @param array $values
    *   Key/value event info.
-   * @return boolean true if allow registration otherwise false
+   * @return boolean
+   *   true if allow registration otherwise false
    */
   /**
    * @param $values
@@ -1969,7 +1963,7 @@ WHERE  ce.loc_block_id = $locBlockId";
    *
    * @param array $params
    *   Key/value participant info.
-   * @return boolean $alreadyRegistered true/false
+   * @return boolean
    */
   /**
    * @param array $params
@@ -2003,8 +1997,8 @@ WHERE  ce.loc_block_id = $locBlockId";
    * @param int $eventId
    * @param int $type
    *
-   * @return string   the permission that the user has (or null)
-   * @static
+   * @return string
+   *   the permission that the user has (or null)
    */
   public static function checkPermission($eventId = NULL, $type = CRM_Core_Permission::VIEW) {
     static $permissions = NULL;
@@ -2067,8 +2061,8 @@ WHERE  ce.loc_block_id = $locBlockId";
    * @param int $eventId
    *   The id of the event.
    *
-   * @return array         an array of email ids
-   * @static
+   * @return array
+   *   an array of email ids
    */
   public static function getFromEmailIds($eventId = NULL) {
     $fromEmailValues['from_email_id'] = CRM_Core_BAO_Email::getFromEmail();
@@ -2103,8 +2097,8 @@ WHERE  ce.loc_block_id = $locBlockId";
    * @param sting $extraWhereClause
    *   Extra filter on participants.
    *
-   * @return int   event total seats w/ given criteria.
-   * @static
+   * @return int
+   *   event total seats w/ given criteria.
    */
   public static function eventTotalSeats($eventId, $extraWhereClause = NULL) {
     if (empty($eventId)) {
@@ -2149,7 +2143,8 @@ LEFT  JOIN  civicrm_price_field_value value ON ( value.id = lineItem.price_field
    * @param int $templateId
    *   Event template id.
    *
-   * @return array of custom data defaults.
+   * @return array
+   *   Array of custom data defaults.
    */
   public static function getTemplateDefaultValues($templateId) {
     $defaults = array();
@@ -2223,7 +2218,7 @@ LEFT  JOIN  civicrm_price_field_value value ON ( value.id = lineItem.price_field
         // Fixme - this is going to ignore context, better to get conditions, add params, and call PseudoConstant::get
         return CRM_Financial_BAO_FinancialType::getIncomeFinancialType();
 
-      break;
+        break;
     }
     return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
   }