fix investigating class name

This commit is contained in:
Marc Michalsky forumZFD 2020-12-14 17:22:55 +01:00
parent 49acd7dac9
commit 6b7ca6078e
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
3 changed files with 3 additions and 6 deletions

View file

@ -43,8 +43,8 @@ abstract class CRM_TwingleCampaign_BAO_Campaign {
*/
protected function __construct(array $campaign, string $origin) {
$className = explode('_', get_class($this));
$this->className = array_pop($className);
$tmpClassName = explode('_', get_class($this));
$this->className = array_pop($tmpClassName);
// If values come from CiviCRM Campaign API
if ($origin == self::CIVICRM) {

View file

@ -23,8 +23,6 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
protected function __construct(array $event, string $origin) {
parent::__construct($event, $origin);
$className = explode('_', (new ReflectionClass($this))->getShortName());
$this->className = array_pop($className);;
$this->prefix = 'twingle_event_';
$this->values['campaign_type_id'] = 'twingle_event';
$this->id_custom_field = Cache::getInstance()

View file

@ -22,8 +22,7 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
function __construct(array $project, string $origin) {
parent::__construct($project, $origin);
$className = explode('_', (new ReflectionClass($this))->getShortName());
$this->className = array_pop($className);;
$this->id = $id;
$this->prefix = 'twingle_project_';
$this->values['campaign_type_id'] = 'twingle_project';
$this->id_custom_field = Cache::getInstance()