Changeset 1583

Show
Ignore:
Timestamp:
25.02.2010 15:03:39 (5 months ago)
Author:
francois
Message:

[1.5] Added more minor optimizations

Location:
branches/1.5/runtime/lib
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/1.5/runtime/lib/Propel.php

    r1582 r1583  
    460460                } 
    461461 
    462                 if (!array_key_exists($name, self::$dbMaps)) { 
     462                if (!isset(self::$dbMaps[$name])) { 
    463463                        $clazz = self::$databaseMapClass; 
    464464                        self::$dbMaps[$name] = new $clazz($name); 
  • branches/1.5/runtime/lib/config/PropelConfiguration.php

    r1347 r1583  
    6060        public function offsetExists($offset) 
    6161        { 
    62                 return isset($this->parameter[$offset]) || array_key_exists($offset, $this->parameters); 
     62                return array_key_exists($offset, $this->parameters); 
    6363        } 
    6464 
     
    100100                $parts = explode('.', $name); //name.space.name 
    101101                while ($part = array_shift($parts)) { 
    102                         if (array_key_exists($part, $ret)) { 
     102                        if (isset($ret[$part])) { 
    103103                                $ret = $ret[$part]; 
    104104                        } else { 
  • branches/1.5/runtime/lib/query/ModelCriteria.php

    r1580 r1583  
    481481                list($fullName, $relationAlias) = self::getClassAndAlias($relation); 
    482482                if (strpos($fullName, '.') === false) { 
    483                         $tableMap = $this->getTableMap(); 
     483                        // simple relation name, refers to the current table 
    484484                        $leftName = $this->getModelAliasOrName(); 
    485485                        $relationName = $fullName; 
    486486                        $previousJoin = null; 
     487                        $tableMap = $this->getTableMap(); 
    487488                } else { 
    488489                        list($leftName, $relationName) = explode('.', $fullName); 
     
    491492                                $previousJoin = null; 
    492493                                $tableMap = $this->getTableMap(); 
    493                         } elseif (array_key_exists($leftName, $this->joins)) { 
     494                        } elseif (isset($this->joins[$leftName])) { 
    494495                                $previousJoin = $this->joins[$leftName]; 
    495496                                $tableMap = $previousJoin->getTableMap(); 
     
    498499                        } 
    499500                } 
    500                 $leftTableAlias = array_key_exists($leftName, $this->aliases) ? $leftName : null; 
     501                $leftTableAlias = isset($this->aliases[$leftName]) ? $leftName : null; 
    501502                 
    502503                // find the RelationMap in the TableMap using the $relationName 
     
    589590        public function with($relation) 
    590591        { 
    591                 if (!array_key_exists($relation, $this->joins)) { 
     592                if (!isset($this->joins[$relation])) { 
    592593                        throw new PropelException('Unknown relation name or alias ' . $relation); 
    593594                } 
     
    665666        public function useQuery($relationName, $secondaryCriteriaClass = null) 
    666667        { 
    667                 if (!array_key_exists($relationName, $this->joins)) { 
     668                if (!isset($this->joins[$relationName])) { 
    668669                        throw new PropelException('Unknown class or alias ' . $name); 
    669670                } 
     
    691692        public function endUse() 
    692693        { 
    693                 if (array_key_exists($this->modelAlias, $this->aliases)) { 
     694                if (isset($this->aliases[$this->modelAlias])) { 
    694695                        unset($this->aliases[$this->modelAlias]); 
    695696                } 
     
    14511452                        // column of the Criteria's model 
    14521453                        $tableMap = $this->getTableMap(); 
    1453                 } elseif (array_key_exists($class, $this->joins)) { 
     1454                } elseif (isset($this->joins[$class])) { 
    14541455                        // column of a relations's model 
    14551456                        $tableMap = $this->joins[$class]->getTableMap(); 
     
    14641465                if ($tableMap->hasColumnByPhpName($phpName)) { 
    14651466                        $column = $tableMap->getColumnByPhpName($phpName); 
    1466                         if (array_key_exists($class, $this->aliases)) { 
     1467                        if (isset($this->aliases[$class])) { 
    14671468                                $this->currentAlias = $class; 
    14681469                                $realColumnName = $class . '.' . $column->getName();