[Isocial-svn] SF.net SVN: isocial: [47] akelos.diff
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <agu...@us...> - 2008-03-09 12:49:42
|
Revision: 47 http://isocial.svn.sourceforge.net/isocial/?rev=47&view=rev Author: aguidrevitch Date: 2008-03-09 05:49:47 -0700 (Sun, 09 Mar 2008) Log Message: ----------- more patches to akelos : AkActiveRecord::count fixed Modified Paths: -------------- akelos.diff Modified: akelos.diff =================================================================== --- akelos.diff 2008-03-09 12:04:55 UTC (rev 46) +++ akelos.diff 2008-03-09 12:49:47 UTC (rev 47) @@ -1,8 +1,8 @@ Index: lib/Ak.php =================================================================== ---- lib/Ak.php (revision 500) +--- lib/Ak.php (revision 505) +++ lib/Ak.php (working copy) -@@ -186,6 +186,11 @@ +@@ -183,6 +183,11 @@ return @$string[$try_whith_lang]; } @@ -14,7 +14,7 @@ if(isset($controller) && !isset($framework_dictionary[$controller.'_dictionary']) && is_file(AK_APP_DIR.DS.'locales'.DS.$controller.DS.$lang.'.php')){ require(AK_APP_DIR.DS.'locales'.DS.$controller.DS.$lang.'.php'); $framework_dictionary[$controller.'_dictionary'] = (array)$dictionary; -@@ -193,6 +198,8 @@ +@@ -190,6 +195,8 @@ if(isset($controller) && isset($framework_dictionary[$controller.'_dictionary'][$string])){ $string = $framework_dictionary[$controller.'_dictionary'][$string]; @@ -25,7 +25,7 @@ } Index: lib/AkActiveRecord.php =================================================================== ---- lib/AkActiveRecord.php (revision 500) +--- lib/AkActiveRecord.php (revision 505) +++ lib/AkActiveRecord.php (working copy) @@ -4721,7 +4721,7 @@ $resulting_array = array(); @@ -36,3 +36,43 @@ } } return $resulting_array; +@@ -5003,8 +5003,27 @@ + + $sql .= empty($options['joins']) ? '' : " {$options['joins']} "; + ++ //$this->santizeSql(conditions); ++ if(!empty($options['conditions']) && is_array($options['conditions'])){ ++ if (isset($options['conditions'][0]) && strstr($options['conditions'][0], '?') && count($options['conditions']) > 1){ ++ //array('conditions' => array("name=?",$name)) ++ $pattern = array_shift($options['conditions']); ++ $options['bind'] = array_values($options['conditions']); ++ $options['conditions'] = $pattern; ++ }elseif (isset($options['conditions'][0])){ ++ //array('conditions' => array("user_name = :user_name", ':user_name' => 'hilario') ++ $pattern = array_shift($options['conditions']); ++ $options['conditions'] = str_replace(array_keys($options['conditions']), array_values($this->getSanitizedConditionsArray($options['conditions'])),$pattern); ++ }else{ ++ //array('conditions' => array('user_name'=>'Hilario')) ++ $options['conditions'] = join(' AND ',(array)$this->getAttributesQuoted($options['conditions'])); ++ } ++ } ++ ++ + empty($options['conditions']) ? null : $this->addConditions($sql, $options['conditions']); + ++ + if (!empty($options['group'])){ + $sql .= " GROUP BY {$options['group_field']} "; + $sql .= empty($options['having']) ? '' : " HAVING {$options['having']} "; +@@ -5013,6 +5032,11 @@ + $sql .= empty($options['order']) ? '' : " ORDER BY {$options['order']} "; + $this->_db->addLimitAndOffset($sql, $options); + $sql .= $use_workaround ? ')' : ''; ++ ++ if(!empty($options['bind']) && is_array($options['bind']) && strstr($sql,'?')){ ++ $sql = array_merge(array($sql),$options['bind']); ++ } ++ + return $sql; + } + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |