original_string: protected function _q45( EarthIT_Schema_ResourceClass $rc, array $items ) {
  		$restObjects = array();
  		$keyByIds = $this->shouldKeyRestItemsById($rc);
  		foreach( $items as $item ) {
  			$restItem = $this->internalObjectToRest($rc, $item);
  			if( $keyByIds ) {
  				$restObjects[EarthIT_Storage_Util::itemId($item,$rc)] = $restItem;
  			} else {
  				$restObjects[] = $restItem;
  			}
  		}
  		return $this->jsonTyped($restObjects, $keyByIds ? EarthIT_JSON::JT_OBJECT : EarthIT_JSON::JT_LIST);
  	}
code: protected function _q45( EarthIT_Schema_ResourceClass $rc, array $items ) {
  		$restObjects = array();
  		$keyByIds = $this->shouldKeyRestItemsById($rc);
  		foreach( $items as $item ) {
  			$restItem = $this->internalObjectToRest($rc, $item);
  			if( $keyByIds ) {
  				$restObjects[EarthIT_Storage_Util::itemId($item,$rc)] = $restItem;
  			} else {
  				$restObjects[] = $restItem;
  			}
  		}
  		return $this->jsonTyped($restObjects, $keyByIds ? EarthIT_JSON::JT_OBJECT : EarthIT_JSON::JT_LIST);
  	}
code_tokens: protected function _q45 ( EarthIT_Schema_ResourceClass $ rc , array $ items ) { $ restObjects = array ( ) ; $ keyByIds = $ this -> shouldKeyRestItemsById ( $ rc ) ; foreach ( $ items as $ item ) { $ restItem = $ this -> internalObjectToRest ( $ rc , $ item ) ; if ( $ keyByIds ) { $ restObjects [ EarthIT_Storage_Util :: itemId ( $ item , $ rc ) ] = $ restItem ; } else { $ restObjects [ ] = $ restItem ; } } return $ this -> jsonTyped ( $ restObjects , $ keyByIds ? EarthIT_JSON :: JT_OBJECT : EarthIT_JSON :: JT_LIST ) ; }
docstring: Convert the given rows from DB to REST format according to the
  specified resource class.
docstring_tokens: Convert the given rows from DB to REST format according to the specified resource class .