Attila/core/Model.php
public function find($oEntityCriteria)
	{
		$this->_checkEntity($oEntityCriteria);
		$aEntity = get_object_vars(LibEntity::getRealEntity($oEntityCriteria));

		$sPrimaryKeyName = LibEntity::getPrimaryKeyName($oEntityCriteria);

		$aResults = $this->orm
			 			 ->select(array('*'))
			 			 ->from($this->_sTableName)
			 			 ->where(array($sPrimaryKeyName => $aEntity[$sPrimaryKeyName]))
						 ->load();

		if ($aResults) { return $aResults[0]; }

		if ($this->_isFilter()) {
		    
		    foreach ($aResults as $iKey => $oValue) {
		        
		        $aResults[$iKey] = $this->_applyFilter($oValue);
		    }
		}

		return $aResults;
	}
public function find($oEntityCriteria)
	{
		$this->_checkEntity($oEntityCriteria);
		$aEntity = get_object_vars(LibEntity::getRealEntity($oEntityCriteria));

		$sPrimaryKeyName = LibEntity::getPrimaryKeyName($oEntityCriteria);

		$aResults = $this->orm
			 			 ->select(array('*'))
			 			 ->from($this->_sTableName)
			 			 ->where(array($sPrimaryKeyName => $aEntity[$sPrimaryKeyName]))
						 ->load();

		if ($aResults) { return $aResults[0]; }

		if ($this->_isFilter()) {
		    
		    foreach ($aResults as $iKey => $oValue) {
		        
		        $aResults[$iKey] = $this->_applyFilter($oValue);
		    }
		}

		return $aResults;
	}
public function find ( $ oEntityCriteria ) { $ this -> _checkEntity ( $ oEntityCriteria ) ; $ aEntity = get_object_vars ( LibEntity :: getRealEntity ( $ oEntityCriteria ) ) ; $ sPrimaryKeyName = LibEntity :: getPrimaryKeyName ( $ oEntityCriteria ) ; $ aResults = $ this -> orm -> select ( array ( '*' ) ) -> from ( $ this -> _sTableName ) -> where ( array ( $ sPrimaryKeyName => $ aEntity [ $ sPrimaryKeyName ] ) ) -> load ( ) ; if ( $ aResults ) { return $ aResults [ 0 ] ; } if ( $ this -> _isFilter ( ) ) { foreach ( $ aResults as $ iKey => $ oValue ) { $ aResults [ $ iKey ] = $ this -> _applyFilter ( $ oValue ) ; } } return $ aResults ; }
classic method to find an entity

@access public
@param  object $oEntityCriteria
@return array
classic method to find an entity