Merge pull request #4863 from totten/master-phpcbf4
[civicrm-core.git] / CRM / Core / BAO / Extension.php
index 81d902a627c2c55d03b388e290fcd0e88aa022f7..bc785846a90d297ce7f60bc747dead9b6cc6f6b6 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright (C) 2011 Marty Wright                                    |
  | Licensed to CiviCRM under the Academic Free License version 3.0.   |
 class CRM_Core_BAO_Extension extends CRM_Core_DAO_Extension {
 
   /**
-   * Takes a bunch of params that are needed to match certain criteria and
-   * retrieves the relevant objects. Typically the valid params are only
-   * contact_id. We'll tweak this function to be more full featured over a period
-   * of time. This is the inverse function of create. It also stores all the retrieved
-   * values in the default array
+   * Fetch object based on array of properties
    *
-   * @param array $params   (reference ) an assoc array of name/value pairs
-   * @param array $defaults (reference ) an assoc array to hold the flattened values
+   * @param array $params
+   *   (reference ) an assoc array of name/value pairs.
+   * @param array $defaults
+   *   (reference ) an assoc array to hold the flattened values.
    *
-   * @return object CRM_Core_BAO_LocationType object on success, null otherwise
-   * @access public
+   * @return CRM_Core_BAO_LocationType object on success, null otherwise
    * @static
    */
-  static function retrieve(&$params, &$defaults) {
+  public static function retrieve(&$params, &$defaults) {
     $extension = new CRM_Core_DAO_Extension();
     $extension->copyValues($params);
     if ($extension->find(TRUE)) {
@@ -64,16 +61,16 @@ class CRM_Core_BAO_Extension extends CRM_Core_DAO_Extension {
   }
 
   /**
-   * Function to delete an extension
+   * Delete an extension
    *
-   * @param  int  $id     Id of the extension to be deleted.
+   * @param int $id
+   *   Id of the extension to be deleted.
    *
    * @return void
    *
-   * @access public
    * @static
    */
-  static function del($id) {
+  public static function del($id) {
     $extension = new CRM_Core_DAO_Extension();
     $extension->id = $id;
     return $extension->delete();
@@ -82,11 +79,13 @@ class CRM_Core_BAO_Extension extends CRM_Core_DAO_Extension {
   /**
    * Change the schema version of an extension
    *
-   * @param $fullName string, the fully-qualified name (eg "com.example.myextension")
-   * @param $schemaVersion string
+   * @param $fullName
+   *   String, the fully-qualified name (eg "com.example.myextension").
+   * @param $schemaVersion
+   *   String.
    * @return void
    */
-  static function setSchemaVersion($fullName, $schemaVersion) {
+  public static function setSchemaVersion($fullName, $schemaVersion) {
     $sql = 'UPDATE civicrm_extension SET schema_version = %1 WHERE full_name = %2';
     $params = array(
       1 => array($schemaVersion, 'String'),
@@ -98,10 +97,11 @@ class CRM_Core_BAO_Extension extends CRM_Core_DAO_Extension {
   /**
    * Determine the schema version of an extension
    *
-   * @param $fullName string, the fully-qualified name (eg "com.example.myextension")
+   * @param $fullName
+   *   String, the fully-qualified name (eg "com.example.myextension").
    * @return string
    */
-  static function getSchemaVersion($fullName) {
+  public static function getSchemaVersion($fullName) {
     $sql = 'SELECT schema_version FROM civicrm_extension WHERE full_name = %1';
     $params = array(
       1 => array($fullName, 'String'),