public function foreignKey($primaryKey) {
		$result = [];
		$entity = $this->_classes['entity'];
		$keys = ($this->type() === 'belongsTo') ? array_flip($this->key()) : $this->key();
		$primaryKey = ($primaryKey instanceof $entity) ? $primaryKey->to('array') : $primaryKey;

		foreach ($keys as $key => $foreignKey) {
			$result[$foreignKey] = $primaryKey[$key];
		}
		return $result;
	}
public function foreignKey($primaryKey) {
		$result = [];
		$entity = $this->_classes['entity'];
		$keys = ($this->type() === 'belongsTo') ? array_flip($this->key()) : $this->key();
		$primaryKey = ($primaryKey instanceof $entity) ? $primaryKey->to('array') : $primaryKey;

		foreach ($keys as $key => $foreignKey) {
			$result[$foreignKey] = $primaryKey[$key];
		}
		return $result;
	}
public function foreignKey ( $ primaryKey ) { $ result = [ ] ; $ entity = $ this -> _classes [ 'entity' ] ; $ keys = ( $ this -> type ( ) === 'belongsTo' ) ? array_flip ( $ this -> key ( ) ) : $ this -> key ( ) ; $ primaryKey = ( $ primaryKey instanceof $ entity ) ? $ primaryKey -> to ( 'array' ) : $ primaryKey ; foreach ( $ keys as $ key => $ foreignKey ) { $ result [ $ foreignKey ] = $ primaryKey [ $ key ] ; } return $ result ; }
Build foreign keys from primary keys array.

@param $primaryKey An array where keys are primary keys and values are
the associated values of primary keys.
@return array An array where keys are foreign keys and values are
the associated values of foreign keys.
Build foreign keys from primary keys array .