X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FPaperSize.php;h=2608314c1965e9053903fa8fe124ab7cba0e5f8b;hb=b100f0b5a1cfef21fdacd35deb07e13d94ecadd6;hp=796b9074c161a41624f6d58f7149c0f685bc5538;hpb=e9aca61e8b08d5ae372621c4397108b8f2ec28ba;p=civicrm-core.git diff --git a/CRM/Core/BAO/PaperSize.php b/CRM/Core/BAO/PaperSize.php index 796b9074c1..2608314c19 100644 --- a/CRM/Core/BAO/PaperSize.php +++ b/CRM/Core/BAO/PaperSize.php @@ -70,9 +70,8 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Get Option Group ID for Paper Sizes * - * @param void - * - * @return int Group ID (null if Group ID doesn't exist) + * @return int + * Group ID (null if Group ID doesn't exist) */ private static function _getGid() { if (!self::$_gid) { @@ -87,11 +86,10 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Add ordering fields to Paper Size list * - * @param array (reference) $list List of Paper Sizes - * @param string $returnURL URL of page calling this function + * @param array (reference) $list List of Paper Sizes + * @param string $returnURL + * URL of page calling this function. * - * @return array (reference) List of Paper Sizes - * @static */ public static function &addOrder(&$list, $returnURL) { $filter = "option_group_id = " . self::_getGid(); @@ -101,10 +99,11 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Retrieve list of Paper Sizes. * - * @param bool $namesOnly return simple list of names + * @param bool $namesOnly + * Return simple list of names. * - * @return array (reference) Paper Size list - * @static + * @return array + * (reference) Paper Size list */ public static function &getList($namesOnly = FALSE) { static $list = array(); @@ -130,10 +129,8 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Retrieve the default Paper Size values * - * @param NULL - * - * @return array Name/value pairs containing the default Paper Size values. - * @static + * @return array + * Name/value pairs containing the default Paper Size values. */ public static function &getDefaultValues() { $params = array('is_active' => 1, 'is_default' => 1); @@ -151,10 +148,13 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Get Paper Size from the DB * - * @param string $field Field name to search by - * @param int $val Field value to search for + * @param string $field + * Field name to search by. + * @param int $val + * Field value to search for. * - * @return array $values (reference) associative array of name/value pairs + * @return array + * (reference) associative array of name/value pairs */ public static function &getPaperFormat($field, $val) { $params = array('is_active' => 1, $field => $val); @@ -170,9 +170,11 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Get Paper Size by Name * - * @param int $name Paper Size name. Empty = get default Paper Size + * @param int $name + * Paper Size name. Empty = get default Paper Size. * - * @return array $values (reference) associative array of name/value pairs + * @return array + * (reference) associative array of name/value pairs */ public static function &getByName($name) { return self::getPaperFormat('name', $name); @@ -181,9 +183,11 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Get Paper Size by ID * - * @param int $id Paper Size id. 0 = get default Paper Size + * @param int $id + * Paper Size id. 0 = get default Paper Size. * - * @return array $values (reference) associative array of name/value pairs + * @return array + * (reference) associative array of name/value pairs */ public static function &getById($id) { return self::getPaperFormat('id', $id); @@ -192,20 +196,20 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Get Paper Size field from associative array * - * @param string $field name of a Paper Size field + * @param string $field + * Name of a Paper Size field. * @param array (reference) $values associative array of name/value pairs containing * Paper Size field selections * * @param null $default * * @return value - * @static */ public static function getValue($field, &$values, $default = NULL) { if (array_key_exists($field, self::$optionValueFields)) { switch (self::$optionValueFields[$field]['type']) { case CRM_Utils_Type::T_INT: - return (int)CRM_Utils_Array::value($field, $values, $default); + return (int) CRM_Utils_Array::value($field, $values, $default); case CRM_Utils_Type::T_FLOAT: // Round float values to three decimal places and trim trailing zeros. @@ -213,7 +217,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { $f = sprintf('%05.3f', $values[$field]); $f = rtrim($f, '0'); $f = rtrim($f, '.'); - return (float)(empty($f) ? '0' : $f); + return (float) (empty($f) ? '0' : $f); } return CRM_Utils_Array::value($field, $values, $default); } @@ -225,11 +229,12 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { * retrieves the relevant objects. Typically the valid params are only * paper size id. It also stores all the retrieved values in the default array. * - * @param array $params (reference ) an assoc array of name/value pairs - * @param array $values (reference ) an assoc array to hold the flattened values + * @param array $params + * (reference ) an assoc array of name/value pairs. + * @param array $values + * (reference ) an assoc array to hold the flattened values. * - * @return CRM_Core_DAO_OptionValue object - * @static + * @return CRM_Core_DAO_OptionValue */ public static function retrieve(&$params, &$values) { $optionValue = new CRM_Core_DAO_OptionValue(); @@ -260,8 +265,9 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Save the Paper Size in the DB * - * @param array (reference) $values associative array of name/value pairs - * @param int $id id of the database record (null = new record) + * @param array (reference) $values associative array of name/value pairs + * @param int $id + * Id of the database record (null = new record). * * @return void */ @@ -319,9 +325,9 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Delete a Paper Size * - * @param int $id ID of the Paper Size to be deleted. + * @param int $id + * ID of the Paper Size to be deleted. * - * @static */ public static function del($id) { if ($id) {