change argument hash creation

This commit is contained in:
Manuel Raynaud
2014-01-29 21:21:27 +01:00
parent 126851a6c9
commit 485816cc4c
3 changed files with 14 additions and 3 deletions

View File

@@ -339,7 +339,7 @@ abstract class BaseLoop
public function count()
{
$hash = $this->args->getHash();
if(false === array_key_exists($hash, self::$cacheCount))
if(false === isset(self::$cacheCount[$hash]))
{
$count = 0;
if ($this instanceof PropelSearchLoopInterface) {
@@ -370,7 +370,7 @@ abstract class BaseLoop
public function exec(&$pagination)
{
$hash = $this->args->getHash();
if(false === array_key_exists($hash, self::$cacheLoopResult))
if(false === isset(self::$cacheLoopResult[$hash]))
{
if ($this instanceof PropelSearchLoopInterface) {
$searchModelCriteria = $this->buildModelCriteria();

View File

@@ -56,6 +56,11 @@ class Argument
return $this->type->getFormattedValue($this->value);
}
public function getRawValue()
{
return $this->value;
}
public function setValue($value)
{
if ($value === null) {
@@ -147,4 +152,5 @@ class Argument
$empty
);
}
}

View File

@@ -153,6 +153,11 @@ class ArgumentCollection implements \Iterator
unset($arguments['name']);
}
return sha1(serialize($arguments));
$string = '';
foreach ($arguments as $key => $argument) {
$string .= $key.'='.$argument->getRawValue();
}
return md5($string);
}
}