Model/CommonAppModel.php
protected function _filterForeignModels($result, $keep) {
		foreach ($this->belongsToForeignModels as $name => $assoc) {
			if ($keep === $assoc['className']) {
				continue;
			}

			if (isset($result[$name])) {
				unset($result[$name]);
			}
		}

		return $result;
	}
protected function _filterForeignModels($result, $keep) {
		foreach ($this->belongsToForeignModels as $name => $assoc) {
			if ($keep === $assoc['className']) {
				continue;
			}

			if (isset($result[$name])) {
				unset($result[$name]);
			}
		}

		return $result;
	}
protected function _filterForeignModels ( $ result , $ keep ) { foreach ( $ this -> belongsToForeignModels as $ name => $ assoc ) { if ( $ keep === $ assoc [ 'className' ] ) { continue ; } if ( isset ( $ result [ $ name ] ) ) { unset ( $ result [ $ name ] ) ; } } return $ result ; }
Loops through associated `belongsTo` foreign models to keep only the associated one.

@param array $result Original resultset containing all associated `belongsTo` foreign models.
@param string $keepModel Full name of the associated model to keep (i.e. 'Plugin.Model' or 'Model').
@return array Filtered resultset.
Loops through associated belongsTo foreign models to keep only the associated one .