Changeset 980

Show
Ignore:
Timestamp:
08/13/10 10:12:19 (18 months ago)
Author:
ort
Message:

fix entity and add new functions

Location:
trunk/engine
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/engine/classes/Entity.class.php

    r974 r980  
    4545                $aReturn=array(); 
    4646                foreach ($aKeys as $key) { 
    47                         if(key_exists($key,$this->_aData)) { 
     47                        if(array_key_exists($key,$this->_aData)) { 
    4848                                $aReturn[$key] = $this->_aData[$key]; 
    4949                        } 
     
    5252        } 
    5353 
     54        public function _getDataOne($sKey) { 
     55                if(array_key_exists($sKey,$this->_aData)) { 
     56                        return $this->_aData[$sKey]; 
     57                } 
     58                return null; 
     59        } 
     60         
    5461        /** 
    5562         * Ставим хук на вызов неизвестного метода и считаем что хотели вызвать метод какого либо модуля 
     
    7582                                } 
    7683                                return null; 
    77                         } elseif ($sType=='set' and key_exists(0,$aArgs)) { 
     84                        } elseif ($sType=='set' and array_key_exists(0,$aArgs)) { 
    7885                                $this->_aData[$sKey]=$aArgs[0]; 
    7986                        } 
  • trunk/engine/include/function.php

    r896 r980  
    413413    } 
    414414} 
     415 
     416 
     417function func_underscore($sStr) { 
     418        return strtolower(preg_replace('/([^A-Z])([A-Z])/',"$1_$2",$sStr)); 
     419} 
     420 
     421function func_camelize($sStr) { 
     422        $aParts = explode('_',$sStr); 
     423        $sCamelized = ''; 
     424        foreach($aParts as $sPart) { 
     425                $sCamelized .= ucfirst($sPart); 
     426        } 
     427        return $sCamelized; 
     428} 
     429 
    415430?>