2009-10-08 6 views
0
I want to check the last value changes. 
Some times the objectId is the same as another objectId but the value can be different. 
And i cant compare this to get the Last changes. 
How do i do that? 

Ce sont les objetsObtenir les modifications de dernière depuis la dernière valeur Variation

object(stdClass)#38 (6) { 
     ["id"]=> 
     string(7) "1715680" 
     ["objectId"]=> 
     string(1) "1" 
     ["type"]=> 
     string(1) "0" 
     ["field"]=> 
     string(2) "30" 
     ["value"]=> 
     string(1) "3" 
     ["date"]=> 
     string(10) "1239982220" 
    } 
    object(stdClass)#39 (6) { 
     ["id"]=> 
     string(7) "1739382" 
     ["objectId"]=> 
     string(1) "1" 
     ["type"]=> 
     string(1) "0" 
     ["field"]=> 
     string(2) "30" 
     ["value"]=> 
     string(1) "3" 
     ["date"]=> 
     string(10) "1240588802" 
    } 
    object(stdClass)#40 (6) { 
     ["id"]=> 
     string(7) "1762456" 
     ["objectId"]=> 
     string(1) "1" 
     ["type"]=> 
     string(1) "0" 
     ["field"]=> 
     string(2) "30" 
     ["value"]=> 
     string(1) "0" 
     ["date"]=> 
     string(10) "1241195393" 
    } 
+0

Souhaitez-vous obtenir le champ _value_ de l'objet le plus récent (l'objet avec le plus haut _date_)? Je pense que vous devriez essayer d'éditer la question et essayer d'être plus précis sur ce que vous voulez accomplir. – csl

+0

jetez un oeil sur le code source cela dit plus de 1000 mots – streetparade

Répondre

0

Je résolus à ma propre question isnt bon?

$changed = false; 

     while($z = $this->db->fetch($m)) 
     { 
      $array[$z->objectId][$z->field][] = $z; 
     } 

     for($i = 0; $i < count($array); $i++) 
     { 

      $blogs = $array[1][30]; 

      foreach($blogs as $blog) 
      { 
       $blogs[$i]; 
       if($blog->value != $blogs[$i]->value) 
       { 
         $changed = true; 
       } 


      } 

     }