[*] Classes: Tools::property_exists() is deprecated, since PrestaShop now requires 5.1
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9408 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
e5ae345855
commit
30835cb4c8
4 files changed
+12
-9
No files matched your search
@@ -316,8 +316,8 @@ class AddressFormatCore extends ObjectModel
|
|||||||
|
|
||||||
// Check if the property exist in both classes
|
// Check if the property exist in both classes
|
||||||
if (($totalName == 2) && class_exists($associateName[0]) &&
|
if (($totalName == 2) && class_exists($associateName[0]) &&
|
||||||
Tools::property_exists($associateName[0], $associateName[1]) &&
|
property_exists($associateName[0], $associateName[1]) &&
|
||||||
Tools::property_exists($address, 'id_'.strtolower($associateName[0])))
|
property_exists($address, 'id_'.strtolower($associateName[0])))
|
||||||
{
|
{
|
||||||
$idFieldName = 'id_'.strtolower($associateName[0]);
|
$idFieldName = 'id_'.strtolower($associateName[0]);
|
||||||
|
|
||||||
|
|||||||
@@ -1667,12 +1667,15 @@ FileETag INode MTime Size
|
|||||||
/**
|
/**
|
||||||
* Function property_exists does not exist in PHP < 5.1
|
* Function property_exists does not exist in PHP < 5.1
|
||||||
*
|
*
|
||||||
|
* @deprecated since 1.5.0 (PHP 5.1 required, so property_exists() is now natively supported)
|
||||||
* @param object or class $class
|
* @param object or class $class
|
||||||
* @param string $property
|
* @param string $property
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public static function property_exists($class, $property)
|
public static function property_exists($class, $property)
|
||||||
{
|
{
|
||||||
|
Tools::displayAsDeprecated();
|
||||||
|
|
||||||
if (function_exists('property_exists'))
|
if (function_exists('property_exists'))
|
||||||
return property_exists($class, $property);
|
return property_exists($class, $property);
|
||||||
|
|
||||||
|
|||||||
@@ -1420,7 +1420,7 @@ class WebserviceRequestCore
|
|||||||
else
|
else
|
||||||
$object->$fieldProperties['setter']((string)$attributes->$fieldName);
|
$object->$fieldProperties['setter']((string)$attributes->$fieldName);
|
||||||
}
|
}
|
||||||
elseif (Tools::property_exists($object, $sqlId))
|
elseif (property_exists($object, $sqlId))
|
||||||
$object->$sqlId = (string)$attributes->$fieldName;
|
$object->$sqlId = (string)$attributes->$fieldName;
|
||||||
else
|
else
|
||||||
$this->setError(400, 'Parameter "'.$fieldName.'" can\'t be set to the object "'.$this->resourceConfiguration['retrieveData']['className'].'"', 123);
|
$this->setError(400, 'Parameter "'.$fieldName.'" can\'t be set to the object "'.$this->resourceConfiguration['retrieveData']['className'].'"', 123);
|
||||||
@@ -1431,7 +1431,7 @@ class WebserviceRequestCore
|
|||||||
$this->setError(400, 'parameter "'.$fieldName.'" required', 41);
|
$this->setError(400, 'parameter "'.$fieldName.'" required', 41);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
elseif ((!isset($fieldProperties['required']) || !$fieldProperties['required']) && Tools::property_exists($object, $sqlId))
|
elseif ((!isset($fieldProperties['required']) || !$fieldProperties['required']) && property_exists($object, $sqlId))
|
||||||
$object->$sqlId = null;
|
$object->$sqlId = null;
|
||||||
|
|
||||||
if (isset($fieldProperties['i18n']) && $fieldProperties['i18n'])
|
if (isset($fieldProperties['i18n']) && $fieldProperties['i18n'])
|
||||||
|
|||||||
@@ -345,11 +345,11 @@ if ($lm->getIncludeTradFilename())
|
|||||||
</form>
|
</form>
|
||||||
<h3 class="no-margin"><?php echo lang('Did you know?'); ?></h3>
|
<h3 class="no-margin"><?php echo lang('Did you know?'); ?></h3>
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$isoForLink = (in_array($lm->getIsoCodeSelectedLang(), array('fr', 'it', 'de', 'en', 'es')) ? $lm->getIsoCodeSelectedLang() : 'en');
|
$isoForLink = (in_array($lm->getIsoCodeSelectedLang(), array('fr', 'it', 'de', 'en', 'es')) ? $lm->getIsoCodeSelectedLang() : 'en');
|
||||||
echo lang('Prestashop and its community offers over 40 different languages for free download at');
|
echo lang('Prestashop and its community offers over 40 different languages for free download at');
|
||||||
|
|
||||||
?><br /><a href="http://www.prestashop.com/<?php echo $isoForLink; ?>/downloads/#lang_pack" target="_blank">http://www.prestashop.com/<?php echo $isoForLink; ?>/downloads/#lang_pack</a>
|
?><br /><a href="http://www.prestashop.com/<?php echo $isoForLink; ?>/downloads/#lang_pack" target="_blank">http://www.prestashop.com/<?php echo $isoForLink; ?>/downloads/#lang_pack</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -772,9 +772,9 @@ if ($lm->getIncludeTradFilename())
|
|||||||
|
|
||||||
function getPreinstallXmlLang($object, $field)
|
function getPreinstallXmlLang($object, $field)
|
||||||
{
|
{
|
||||||
if (Tools::property_exists($object, $field.'_'.((int)($_GET['language'])+1)))
|
if (property_exists($object, $field.'_'.((int)($_GET['language'])+1)))
|
||||||
return str_replace(array('!|', '|!'), array('<', '>'), trim($object->{$field.'_'.((int)($_GET['language'])+1)}));
|
return str_replace(array('!|', '|!'), array('<', '>'), trim($object->{$field.'_'.((int)($_GET['language'])+1)}));
|
||||||
if (Tools::property_exists($object, $field.'_1'))
|
if (property_exists($object, $field.'_1'))
|
||||||
return str_replace(array('!|', '|!'), array('<', '>'), trim($object->{$field.'_1'}));
|
return str_replace(array('!|', '|!'), array('<', '>'), trim($object->{$field.'_1'}));
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user