code: public static function createFromDbResult(Result $objResult, $strTable)
  	{
  		$arrModels = array();
  		$strClass = Model::getClassFromTable($strTable);
  
  		while ($objResult->next())
  		{
  			/** @var Model $strClass */
  			$objModel = Registry::getInstance()->fetch($strTable, $objResult->{$strClass::getPk()});
  
  			if ($objModel !== null)
  			{
  				$objModel->mergeRow($objResult->row());
  				$arrModels[] = $objModel;
  			}
  			else
  			{
  				$arrModels[] = new $strClass($objResult);
  			}
  		}
  
  		return new static($arrModels, $strTable);
  	}
docs: Create a new collection from a database result
  
  @param Result $objResult The database result object
  @param string $strTable  The table name
  
  @return static The model collection