/** * @return bool */ public function initBeforeChange() { parent::initBeforeChange(); if (0 === strlen($this->IdGroupStr)) { $this->IdGroupStr = $this->GenerateStrId(); } return true; }
/** * @return bool */ public function initBeforeChange() { parent::initBeforeChange(); if (0 < $this->IdTenant) { $this->OverrideSettings = true; } if (!$this->OverrideSettings && !$this->IsDefaultDomain) { /* @var $oApiDomainsManager CApiDomainsManager */ $oApiDomainsManager = CApi::Manager('domains'); $oDefDomain = $oApiDomainsManager->getDefaultDomain(); $aOverridenSettingsMap = $this->GetOverridenSettingsMap(); foreach ($aOverridenSettingsMap as $sName) { $this->{$sName} = $oDefDomain->{$sName}; } } return true; }
/** * @return bool */ public function initBeforeChange() { parent::initBeforeChange(); if (0 === strlen($this->IdContactStr) && (is_int($this->IdContact) && 0 < $this->IdContact || is_string($this->IdContact) && 0 < strlen($this->IdContact))) { $this->IdContactStr = $this->GenerateStrId(); } if (!$this->__LOCK_DATE_MODIFIED__) { $this->DateModified = time(); } switch ((int) $this->PrimaryEmail) { //ReadOnly case EPrimaryEmailType::Home: $this->ViewEmail = (string) $this->HomeEmail; break; case EPrimaryEmailType::Business: $this->ViewEmail = (string) $this->BusinessEmail; break; case EPrimaryEmailType::Other: $this->ViewEmail = (string) $this->OtherEmail; break; } return true; }
/** * Initialize account object before it's changing. Function with the same name is used for other objects in a unified container **api_AContainer**. */ public function initBeforeChange() { parent::initBeforeChange(); $bObsolete = null !== $this->GetObsoleteValue('StorageQuota'); $this->StorageQuota = 0 === $this->StorageQuota ? (int) CApi::GetConf('labs.unlim-quota-limit-size-in-kb', 104857600) : $this->StorageQuota; if (!$bObsolete) { $this->FlushObsolete('StorageQuota'); } }