Files
grzanieplus.pl/plugins/stLanguagePlugin/lib/model/LanguageHasDomain.php
2025-03-12 17:06:23 +01:00

76 lines
1.8 KiB
PHP

<?php
use LanguageHasDomain as GlobalLanguageHasDomain;
/**
* Subclass for representing a row from the 'st_language_has_domain' table.
*
*
*
* @package plugins.stLanguagePlugin.lib.model
*/
class LanguageHasDomain extends BaseLanguageHasDomain
{
public function setUnicodeDomain($value)
{
$domain = idn_to_ascii($value);
if ($domain && $domain != $value)
{
$value = $domain;
}
$this->setDomain($value);
}
public function getUnicodeDomain()
{
$domain = idn_to_utf8($this->getDomain());
return $domain ? $domain : $this->getDomain();
}
/**
* Przeciążenie zapisu
*/
public function save($con = null)
{
if ($this->isColumnModified(LanguageHasDomainPeer::IS_DEFAULT)) {
if ($this->is_default == 1) {
$c1 = new Criteria();
$c1->add(LanguageHasDomainPeer::LANGUAGE_ID, $this->getLanguageId());
$c2 = new Criteria();
$c2->add(LanguageHasDomainPeer::IS_DEFAULT, 0);
BasePeer::doUpdate($c1, $c2, Propel::getConnection());
}
}
$cache = stFunctionCache::getInstance('stLanguagePlugin');
$cache->removeAll();
stFastCacheManager::clearCache();
$result = parent::save($con);
LanguageHasDomainPeer::doSimpleStoreUpdate()->save();
return $result;
}
/**
* Przeciążenie zapisu
*/
public function delete($con = null)
{
$result = parent::delete($con);
$cache = stFunctionCache::getInstance('stLanguagePlugin');
$cache->removeAll();
stFastCacheManager::clearCache();
LanguageHasDomainPeer::doSimpleStoreUpdate()->save();
return $result;
}
}