Merge pull request #6674 from lcdservices/CRM-17148
[civicrm-core.git] / CRM / Core / Component / Info.php
index 9145675271d364de0e5eda3d8f1c6148a05f3c0a..887af332a96d9ca676bc2a0b63d5cd1c1b560303 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | 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        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  * This interface defines methods that need to be implemented
  * for a component to introduce itself to the system.
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -90,8 +90,8 @@ abstract class CRM_Core_Component_Info {
    */
   public $info;
 
-  /*
-   * Stores component keyword
+  /**
+   * Stores component keyword.
    * @var string name of component keyword
    */
   protected $keyword;
@@ -133,7 +133,7 @@ abstract class CRM_Core_Component_Info {
   abstract public function getInfo();
 
   /**
-   * Get a list of entities to register via API
+   * Get a list of entities to register via API.
    *
    * @return array
    *   list of entities; same format as CRM_Utils_Hook::managedEntities(&$entities)
@@ -144,7 +144,7 @@ abstract class CRM_Core_Component_Info {
   }
 
   /**
-   * Provides permissions that are unwise for Anonymous Roles to have
+   * Provides permissions that are unwise for Anonymous Roles to have.
    *
    * @return array
    *   list of permissions
@@ -164,12 +164,13 @@ abstract class CRM_Core_Component_Info {
    *
    * @param bool $getAllUnconditionally
    *
-   * @return array|null collection of permissions, null if none
+   * @return array|null
+   *   collection of permissions, null if none
    */
   abstract public function getPermissions($getAllUnconditionally = FALSE);
 
   /**
-   * Determine how many other records refer to a given record
+   * Determine how many other records refer to a given record.
    *
    * @param CRM_Core_DAO $dao
    *   The item for which we want a reference count.
@@ -184,19 +185,21 @@ abstract class CRM_Core_Component_Info {
   }
 
   /**
-   * Provides information about user dashboard element
+   * Provides information about user dashboard element.
    * offered by this component.
    *
-   * @return array|null collection of required dashboard settings,
+   * @return array|null
+   *   collection of required dashboard settings,
    *                    null if no element offered
    */
   abstract public function getUserDashboardElement();
 
   /**
-   * Provides information about user dashboard element
+   * Provides information about user dashboard element.
    * offered by this component.
    *
-   * @return array|null collection of required dashboard settings,
+   * @return array|null
+   *   collection of required dashboard settings,
    *                    null if no element offered
    */
   abstract public function registerTab();
@@ -205,7 +208,8 @@ abstract class CRM_Core_Component_Info {
    * Provides information about advanced search pane
    * offered by this component.
    *
-   * @return array|null collection of required pane settings,
+   * @return array|null
+   *   collection of required pane settings,
    *                    null if no element offered
    */
   abstract public function registerAdvancedSearchPane();
@@ -216,7 +220,8 @@ abstract class CRM_Core_Component_Info {
    * Needs to be implemented in component's information
    * class.
    *
-   * @return array|null collection of activity types
+   * @return array|null
+   *   collection of activity types
    */
   abstract public function getActivityTypes();
 
@@ -224,7 +229,7 @@ abstract class CRM_Core_Component_Info {
    * Provides information whether given component is currently
    * marked as enabled in configuration.
    *
-   * @return boolean
+   * @return bool
    *   true if component is enabled, false if not
    */
   public function isEnabled() {
@@ -238,7 +243,8 @@ abstract class CRM_Core_Component_Info {
   /**
    * Provides component's configuration object.
    *
-   * @return mixed component's configuration object
+   * @return mixed
+   *   component's configuration object
    */
   public function getConfigObject() {
     return $this->_instantiate(self::COMPONENT_CONFIG_CLASS);
@@ -247,7 +253,8 @@ abstract class CRM_Core_Component_Info {
   /**
    * Provides component's menu definition object.
    *
-   * @return mixed component's menu definition object
+   * @return mixed
+   *   component's menu definition object
    */
   public function getMenuObject() {
     return $this->_instantiate(self::COMPONENT_MENU_CLASS);
@@ -256,7 +263,8 @@ abstract class CRM_Core_Component_Info {
   /**
    * Provides component's invocation object.
    *
-   * @return mixed component's invocation object
+   * @return mixed
+   *   component's invocation object
    */
   public function getInvokeObject() {
     return $this->_instantiate(self::COMPONENT_INVOKE_CLASS);
@@ -265,7 +273,8 @@ abstract class CRM_Core_Component_Info {
   /**
    * Provides component's BAO Query object.
    *
-   * @return mixed component's BAO Query object
+   * @return mixed
+   *   component's BAO Query object
    */
   public function getBAOQueryObject() {
     return $this->_instantiate(self::COMPONENT_BAO_QUERY_CLASS);
@@ -282,7 +291,8 @@ abstract class CRM_Core_Component_Info {
   /**
    * Provides component's user dashboard page object.
    *
-   * @return mixed component's User Dashboard applet object
+   * @return mixed
+   *   component's User Dashboard applet object
    */
   public function getUserDashboardObject() {
     return $this->_instantiate(self::COMPONENT_USERDASHBOARD_CLASS);
@@ -291,7 +301,8 @@ abstract class CRM_Core_Component_Info {
   /**
    * Provides component's contact record tab object.
    *
-   * @return mixed component's contact record tab object
+   * @return mixed
+   *   component's contact record tab object
    */
   public function getTabObject() {
     return $this->_instantiate(self::COMPONENT_TAB_CLASS);
@@ -311,7 +322,7 @@ abstract class CRM_Core_Component_Info {
   /**
    * Provides information whether given component uses system wide search.
    *
-   * @return boolean
+   * @return bool
    *   true if component needs search integration
    */
   public function usesSearch() {
@@ -319,7 +330,7 @@ abstract class CRM_Core_Component_Info {
   }
 
   /**
-   * Provides the xml menu files
+   * Provides the xml menu files.
    *
    * @return array
    *   array of menu files
@@ -343,7 +354,8 @@ abstract class CRM_Core_Component_Info {
   /**
    * Helper for figuring out menu XML file location.
    *
-   * @return mixed component's element as class instance
+   * @return mixed
+   *   component's element as class instance
    */
   private function _getMenuXMLPath() {
     global $civicrm_root;
@@ -356,11 +368,13 @@ abstract class CRM_Core_Component_Info {
    *
    * @param $cl
    *
-   * @return mixed component's element as class instance
+   * @return mixed
+   *   component's element as class instance
    */
   private function _instantiate($cl) {
     $className = $this->namespace . '_' . $cl;
     require_once str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
     return new $className();
   }
+
 }