X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FReference%2FOptionValue.php;h=94db03591258208aa3d630ebfd4632a739c2b7f8;hb=594eddc519b33992b5f046fa91627c87966e2527;hp=7229af33d775db9440cf9973c33a2b8d0eb53907;hpb=a0ee39412f184b0b9406094847554851ca2869f2;p=civicrm-core.git diff --git a/CRM/Core/Reference/OptionValue.php b/CRM/Core/Reference/OptionValue.php index 7229af33d7..94db035912 100644 --- a/CRM/Core/Reference/OptionValue.php +++ b/CRM/Core/Reference/OptionValue.php @@ -21,7 +21,7 @@ class CRM_Core_Reference_OptionValue extends CRM_Core_Reference_Basic { * @param string $targetKey * @param null $optionGroupName */ - function __construct($refTable, $refKey, $targetTable = NULL, $targetKey = 'id', $optionGroupName) { + public function __construct($refTable, $refKey, $targetTable = NULL, $targetKey = 'id', $optionGroupName) { parent::__construct($refTable, $refKey, $targetTable, $targetKey, NULL); $this->targetOptionGroupName = $optionGroupName; } @@ -33,12 +33,13 @@ class CRM_Core_Reference_OptionValue extends CRM_Core_Reference_Basic { * @throws CRM_Core_Exception */ public function findReferences($targetDao) { - if (! ($targetDao instanceof CRM_Core_DAO_OptionValue)) { + if (!($targetDao instanceof CRM_Core_DAO_OptionValue)) { throw new CRM_Core_Exception("Mismatched reference: expected OptionValue but received " . get_class($targetDao)); } if ($targetDao->option_group_id == $this->getTargetOptionGroupId()) { return parent::findReferences($targetDao); - } else { + } + else { return NULL; } } @@ -50,12 +51,13 @@ class CRM_Core_Reference_OptionValue extends CRM_Core_Reference_Basic { * @throws CRM_Core_Exception */ public function getReferenceCount($targetDao) { - if (! ($targetDao instanceof CRM_Core_DAO_OptionValue)) { + if (!($targetDao instanceof CRM_Core_DAO_OptionValue)) { throw new CRM_Core_Exception("Mismatched reference: expected OptionValue but received " . get_class($targetDao)); } if ($targetDao->option_group_id == $this->getTargetOptionGroupId()) { return parent::getReferenceCount($targetDao); - } else { + } + else { return NULL; } } @@ -69,4 +71,5 @@ class CRM_Core_Reference_OptionValue extends CRM_Core_Reference_Basic { } return $this->targetOptionGroupId; } + }